diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-10-29 16:45:53 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-10-29 20:25:39 +0100 |
commit | 7605de7303f57c1320d96d5ff833f492d002cfb7 (patch) | |
tree | 67237c7bc3b64ca39232e80e880e9ebc7f90a2ee /starmath | |
parent | e4fb4937b3f75ce3544f8de354ed92f7dd314511 (diff) |
Subtraction could wrap
Change-Id: Ifc248835a70ee593e47d50bb0e1bf9165eb06391
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158623
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/view.hxx | 4 | ||||
-rw-r--r-- | starmath/source/document.cxx | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx index 8b17744d6171..03f67fdbed40 100644 --- a/starmath/inc/view.hxx +++ b/starmath/inc/view.hxx @@ -37,8 +37,8 @@ class SmPrintUIOptions; class SmGraphicAccessible; class SmGraphicWidget; -#define MINZOOM sal_uInt16(25) -#define MAXZOOM sal_uInt16(800) +constexpr sal_uInt16 MINZOOM = 25; +constexpr sal_uInt16 MAXZOOM = 800; class SmGraphicWindow final : public InterimItemWindow { diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 715525c94307..29dd3f2ef411 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -1549,7 +1549,8 @@ void SmDocShell::Impl_Print(OutputDevice& rOutDev, const SmPrintUIOptions& rPrin sal_uInt16 nZ = std::min(o3tl::convert(OutputSize.Width(), 100, GraphicSize.Width()), o3tl::convert(OutputSize.Height(), 100, GraphicSize.Height())); - nZ -= 10; + if (nZ > MINZOOM) + nZ -= 10; Fraction aFraction(std::clamp(nZ, MINZOOM, MAXZOOM), 100); OutputMapMode = MapMode(SmMapUnit(), Point(), aFraction, aFraction); |