diff options
-rw-r--r-- | include/tools/gen.hxx | 2 | ||||
-rw-r--r-- | tools/source/generic/gen.cxx | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx index ebe44840d964..9dfab3a17019 100644 --- a/include/tools/gen.hxx +++ b/include/tools/gen.hxx @@ -459,7 +459,7 @@ public: /// Returns the difference between bottom and top, assuming the range includes one end, but not the other. long getHeight() const { return nBottom - nTop; } /// Set the left edge of the rectangle to x, preserving the width - void setX( long x ) { nRight += x - nLeft; nLeft = x; } + void setX( long x ); /// Set the top edge of the rectangle to y, preserving the height void setY( long y ) { nBottom += y - nTop; nTop = y; } void setWidth( long n ) { nRight = nLeft + n; } diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index 021e421c3b80..db7980ea100a 100644 --- a/tools/source/generic/gen.cxx +++ b/tools/source/generic/gen.cxx @@ -275,5 +275,12 @@ long tools::Rectangle::AdjustBottom( long nVertMoveDelta ) return nBottom; } +void tools::Rectangle::setX( long x ) +{ + if (nRight != RECT_EMPTY) + nRight += x - nLeft; + nLeft = x; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |