diff options
author | Tim Hardeck <thardeck@suse.com> | 2012-01-13 18:22:46 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2012-01-13 23:04:12 +0100 |
commit | 022ce7d362f146ed69f54aae20cf2b8c582e9f8d (patch) | |
tree | 2119b7ead9c05302a72ad77fd199333e255df2ca /sd/source/ui/view | |
parent | 12eb7da661635a64272e32204f246d0a5c299ccd (diff) |
fdo#44173: use a geometric progression for zooming
Zooming does now base on a geometric progression instead of an
arithmetic one.
Since the zoom factor is not only used in Draw but for all other
applications 1.2 seems like a good choice.
Diffstat (limited to 'sd/source/ui/view')
-rw-r--r-- | sd/source/ui/view/viewshel.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 68ebe722f4e1..6c79ec29863f 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -82,6 +82,8 @@ #include <sfx2/request.hxx> #include "SpellDialogChildWindow.hxx" +#include <svx/zoom_def.hxx> + #include "Window.hxx" #include "fupoor.hxx" @@ -125,8 +127,6 @@ private: namespace sd { -static const int DELTA_ZOOM = 10; - sal_Bool ViewShell::IsPageFlipMode(void) const { return this->ISA(DrawViewShell) && mpContentWindow.get() != NULL && @@ -718,9 +718,9 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWi long nNewZoom; if( pData->GetDelta() < 0L ) - nNewZoom = Max( (long) pWin->GetMinZoom(), (long)(nOldZoom - DELTA_ZOOM) ); + nNewZoom = Max( (long) pWin->GetMinZoom(), (long)round( nOldZoom / ZOOM_FACTOR )); else - nNewZoom = Min( (long) pWin->GetMaxZoom(), (long)(nOldZoom + DELTA_ZOOM) ); + nNewZoom = Min( (long) pWin->GetMaxZoom(), (long)round( nOldZoom * ZOOM_FACTOR )); SetZoom( nNewZoom ); Invalidate( SID_ATTR_ZOOM ); |