diff options
-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; } |