diff options
author | Noel Grandin <noel@peralex.com> | 2015-08-20 14:22:06 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-08-25 09:58:31 +0200 |
commit | 258643235c1d6ac21f7b53c94493625a0a6c95bc (patch) | |
tree | 2f81aa918859511173cfcc15cc3bbd2e4e06bbf8 /include/tools | |
parent | 666fb214e93d542dd80e48b9e008727129b5764f (diff) |
add some comments to Rectangle mutation methods
Change-Id: I7e1d737fc1e7a431afd3cde74c2c974e0cbef9ef
Diffstat (limited to 'include/tools')
-rw-r--r-- | include/tools/gen.hxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx index bd02f237990a..e0b7acefecc5 100644 --- a/include/tools/gen.hxx +++ b/include/tools/gen.hxx @@ -371,7 +371,8 @@ public: inline Point RightCenter() 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 SetPos( const Point& rPoint ); void SetSize( const Size& rSize ); @@ -415,8 +416,10 @@ public: long getWidth() const { return nRight - nLeft; } /// Returns the difference between bottom and top, assuming the range includes one end, but not the other. long getHeight() const { return nBottom - nTop; } - void setX( long n ) { nRight += n-nLeft; nLeft = n; } - void setY( long n ) { nBottom += n-nTop; nTop = n; } + /// Set the left edge of the rectangle to x, preserving the width + 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 setHeight( long n ) { nBottom = nTop + n; } /// Returns the string representation of the rectangle, format is "x, y, width, height". |