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 /svx | |
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 'svx')
-rw-r--r-- | svx/inc/svx/zoom_def.hxx | 3 | ||||
-rw-r--r-- | svx/source/stbctrls/zoomsliderctrl.cxx | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/svx/inc/svx/zoom_def.hxx b/svx/inc/svx/zoom_def.hxx index 0a244763ed98..e1944931e01d 100644 --- a/svx/inc/svx/zoom_def.hxx +++ b/svx/inc/svx/zoom_def.hxx @@ -8,4 +8,7 @@ #endif +// zoom factor for Calc, Writer, Draw and Impress +#define ZOOM_FACTOR 1.2 + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/stbctrls/zoomsliderctrl.cxx b/svx/source/stbctrls/zoomsliderctrl.cxx index aa8ae8a58972..b27048025d8d 100644 --- a/svx/source/stbctrls/zoomsliderctrl.cxx +++ b/svx/source/stbctrls/zoomsliderctrl.cxx @@ -36,6 +36,8 @@ #include <svx/dialmgr.hxx> #include <svx/dialogs.hrc> +#include <svx/zoom_def.hxx> + #include <set> // ----------------------------------------------------------------------- @@ -357,11 +359,11 @@ sal_Bool SvxZoomSliderControl::MouseButtonDown( const MouseEvent & rEvt ) // click to - button if ( nXDiff >= nButtonLeftOffset && nXDiff <= nButtonRightOffset ) - mpImpl->mnCurrentZoom = mpImpl->mnCurrentZoom - 5; + mpImpl->mnCurrentZoom = round( mpImpl->mnCurrentZoom / ZOOM_FACTOR ); // click to + button else if ( nXDiff >= aControlRect.GetWidth() - nSliderXOffset + nButtonLeftOffset && nXDiff <= aControlRect.GetWidth() - nSliderXOffset + nButtonRightOffset ) - mpImpl->mnCurrentZoom = mpImpl->mnCurrentZoom + 5; + mpImpl->mnCurrentZoom = round( mpImpl->mnCurrentZoom * ZOOM_FACTOR ); // click to slider else if( nXDiff >= nSliderXOffset && nXDiff <= aControlRect.GetWidth() - nSliderXOffset ) mpImpl->mnCurrentZoom = Offset2Zoom( nXDiff ); |