Kaydet (Commit) 25864323 authored tarafından Noel Grandin's avatar Noel Grandin

add some comments to Rectangle mutation methods

Change-Id: I7e1d737fc1e7a431afd3cde74c2c974e0cbef9ef
üst 666fb214
...@@ -371,7 +371,8 @@ public: ...@@ -371,7 +371,8 @@ public:
inline Point RightCenter() const; inline Point RightCenter() const;
inline Point Center() const; inline Point Center() const;
inline void Move( long nHorzMove, long nVertMove ); /// Move the top and left edges by a delta, preserving width and height
inline void Move( long nHorzMoveDelta, long nVertMoveDelta );
inline void Transpose(); inline void Transpose();
inline void SetPos( const Point& rPoint ); inline void SetPos( const Point& rPoint );
void SetSize( const Size& rSize ); void SetSize( const Size& rSize );
...@@ -415,8 +416,10 @@ public: ...@@ -415,8 +416,10 @@ public:
long getWidth() const { return nRight - nLeft; } long getWidth() const { return nRight - nLeft; }
/// Returns the difference between bottom and top, assuming the range includes one end, but not the other. /// Returns the difference between bottom and top, assuming the range includes one end, but not the other.
long getHeight() const { return nBottom - nTop; } long getHeight() const { return nBottom - nTop; }
void setX( long n ) { nRight += n-nLeft; nLeft = n; } /// Set the left edge of the rectangle to x, preserving the width
void setY( long n ) { nBottom += n-nTop; nTop = n; } void setX( long x ) { nLeft = x; nRight += x - nLeft; }
/// Set the top edge of the rectangle to y, preserving the height
void setY( long y ) { nTop = y; nBottom += y - nTop; }
void setWidth( long n ) { nRight = nLeft + n; } void setWidth( long n ) { nRight = nLeft + n; }
void setHeight( long n ) { nBottom = nTop + n; } void setHeight( long n ) { nBottom = nTop + n; }
/// Returns the string representation of the rectangle, format is "x, y, width, height". /// Returns the string representation of the rectangle, format is "x, y, width, height".
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment