summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorRafael Lima <rafael.palma.lima@gmail.com>2023-02-11 16:36:00 -0300
committerJim Raykowski <raykowj@gmail.com>2023-02-11 21:07:31 +0000
commitc96e1ec61835bc01e2969ec97fce9a1674fbf6d7 (patch)
tree6823bac3ac7dba2d36943546635990ff1e66c162 /sd
parent382892341a63e400f221e1a533fd5a5d6b4d9d70 (diff)
tdf#45705 Make SID_ZOOM_IN and SID_ZOOM_OUT smoother in Impress
As reported in the bug ticket, the commands SID_ZOOM_IN and SID_ZOOM_OUT are not smooth and increase/decrease zoom at too big steps. This patch uses basegfx::zoomtools to zoom in and out, making it smoother. Change-Id: I801fa6123bf0696046e5d45c7a6b309e7cc3312e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146825 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/drviewse.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index b3183397a084..5a6a7577951e 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -95,6 +95,7 @@
#include <fuformatpaintbrush.hxx>
#include <fuzoom.hxx>
#include <sdmod.hxx>
+#include <basegfx/utils/zoomtools.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -1189,8 +1190,11 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
case SID_ZOOM_OUT: // BASIC
{
+ const sal_uInt16 nOldZoom = GetActiveWindow()->GetZoom();
+ const sal_uInt16 nNewZoom = basegfx::zoomtools::zoomOut(nOldZoom);
+ SetZoom(nNewZoom);
+
mbZoomOnPage = false;
- SetZoom( std::max<::tools::Long>( GetActiveWindow()->GetZoom() / 2, GetActiveWindow()->GetMinZoom() ) );
::tools::Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( ::tools::Rectangle( Point(0,0),
GetActiveWindow()->GetOutputSizePixel()) );
mpZoomList->InsertZoomRect(aVisAreaWin);
@@ -1203,8 +1207,11 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
case SID_ZOOM_IN:
{
+ const sal_uInt16 nOldZoom = GetActiveWindow()->GetZoom();
+ const sal_uInt16 nNewZoom = basegfx::zoomtools::zoomIn(nOldZoom);
+ SetZoom(nNewZoom);
+
mbZoomOnPage = false;
- SetZoom( std::min<::tools::Long>( GetActiveWindow()->GetZoom() * 2, GetActiveWindow()->GetMaxZoom() ) );
::tools::Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( ::tools::Rectangle( Point(0,0),
GetActiveWindow()->GetOutputSizePixel()) );
mpZoomList->InsertZoomRect(aVisAreaWin);