summaryrefslogtreecommitdiff
path: root/include/tools/gen.hxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-08-17 07:50:25 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-08-17 09:21:59 +0200
commit59e969def7488977be8c554d37bebe535c6511cb (patch)
tree6513dfce2329752c71ad5acbfd138c9b7fe59204 /include/tools/gen.hxx
parent615a340fcf05845397ea3c9917e2eadf074b4514 (diff)
Fix ctor taking Point and Size, to properly handle regative sizes
(alinged to SetSize) Change-Id: I123a584ead91faae0fec4d25938529b2d68e4a3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120559 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'include/tools/gen.hxx')
-rw-r--r--include/tools/gen.hxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx
index 5e083e2bffc6..2d23b693fa50 100644
--- a/include/tools/gen.hxx
+++ b/include/tools/gen.hxx
@@ -622,8 +622,8 @@ constexpr inline tools::Rectangle::Rectangle( tools::Long _nLeft, tools::Long _
constexpr inline tools::Rectangle::Rectangle( const Point& rLT, const Size& rSize )
: nLeft( rLT.X())
, nTop( rLT.Y())
- , nRight( rSize.Width() ? nLeft+(rSize.Width()-1) : RECT_EMPTY )
- , nBottom( rSize.Height() ? nTop+(rSize.Height()-1) : RECT_EMPTY )
+ , nRight(rSize.Width() ? nLeft + (rSize.Width() + (rSize.Width() > 0 ? -1 : 1)) : RECT_EMPTY)
+ , nBottom(rSize.Height() ? nTop + (rSize.Height() + (rSize.Height() > 0 ? -1 : 1)) : RECT_EMPTY)
{}
inline void tools::Rectangle::Move( tools::Long nHorzMove, tools::Long nVertMove )