summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTim Hardeck <thardeck@suse.com>2012-01-18 16:42:55 +0100
committerJan Holesovsky <kendy@suse.cz>2012-01-25 12:35:54 +0100
commit315d2ddc161e4b296febe9e54c3cfc9270310bfe (patch)
treedbf07bd17f430ef980074f27f5a540a34abea5c5 /sd
parent554bcf4205ede6ec3adb9f39e676b77054b1e8a1 (diff)
optimized zoom to use more common intervals
Round zoom values beginning with 50 to a multiple of 5, with 100 to one of 10, with 500 to one of 50 and with 1000 to one of 100. The step 100 is enforced to have one fixed point.
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/viewshel.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index b1cc2d302093..e4ae7f017828 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -82,8 +82,7 @@
#include <sfx2/request.hxx>
#include "SpellDialogChildWindow.hxx"
-#include <svx/zoom_def.hxx>
-#include <rtl/math.hxx>
+#include <basegfx/tools/zoomtools.hxx>
#include "Window.hxx"
#include "fupoor.hxx"
@@ -719,9 +718,9 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWi
long nNewZoom;
if( pData->GetDelta() < 0L )
- nNewZoom = Max( (long) pWin->GetMinZoom(), (long)::rtl::math::round( nOldZoom / ZOOM_FACTOR ));
+ nNewZoom = Max( (long) pWin->GetMinZoom(), basegfx::zoomtools::zoomOut( nOldZoom ));
else
- nNewZoom = Min( (long) pWin->GetMaxZoom(), (long)::rtl::math::round( nOldZoom * ZOOM_FACTOR ));
+ nNewZoom = Min( (long) pWin->GetMaxZoom(), basegfx::zoomtools::zoomIn( nOldZoom ));
SetZoom( nNewZoom );
Invalidate( SID_ATTR_ZOOM );