diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-10 12:38:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-10 21:17:01 +0200 |
commit | bfdd98d214da77b4508bc7d2e9e31817471fe90c (patch) | |
tree | 0f868b2ddad1bc924bb50ab83197dbd7969a3aaa /tools/source | |
parent | 3278dfd0a2c09f8a8862277dffd9ef666d4862c6 (diff) |
make tools::Rectangle::SaturatingSetX/Y respect empty state
Change-Id: Ifef4c2ff967fdfbe122bca99e55d84e8e6c6a635
Reviewed-on: https://gerrit.libreoffice.org/75343
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools/source')
-rw-r--r-- | tools/source/generic/gen.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index 1b9e4a0d733f..fc927f50e41e 100644 --- a/tools/source/generic/gen.cxx +++ b/tools/source/generic/gen.cxx @@ -88,13 +88,15 @@ void tools::Rectangle::SaturatingSetSize(const Size& rSize) void tools::Rectangle::SaturatingSetX(long x) { - nRight = o3tl::saturating_add(nRight, x - nLeft); + if (nRight != RECT_EMPTY) + nRight = o3tl::saturating_add(nRight, x - nLeft); nLeft = x; } void tools::Rectangle::SaturatingSetY(long y) { - nBottom = o3tl::saturating_add(nBottom, y - nTop); + if (nBottom != RECT_EMPTY) + nBottom = o3tl::saturating_add(nBottom, y - nTop); nTop = y; } |