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 /sc | |
parent | changed [pt-PT] default date format to DD-MM-AAAA (was DD-MM-AA) (diff) | |
download | core-022ce7d362f146ed69f54aae20cf2b8c582e9f8d.tar.gz core-022ce7d362f146ed69f54aae20cf2b8c582e9f8d.zip |
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 'sc')
-rw-r--r-- | sc/source/ui/view/prevwsh.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 9 |
2 files changed, 7 insertions, 9 deletions
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index d76622a23ffb..b25a46486347 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -79,8 +79,7 @@ #include "sc.hrc" #include "scabstdlg.hxx" -// fuer Rad-Maus -#define SC_DELTA_ZOOM 10 +// for mouse wheel #define MINZOOM_SLIDER 10 #define MAXZOOM_SLIDER 400 @@ -449,9 +448,9 @@ sal_Bool ScPreviewShell::ScrollCommand( const CommandEvent& rCEvt ) long nOld = pPreview->GetZoom(); long nNew = nOld; if ( pData->GetDelta() < 0 ) - nNew = Max( (long) MINZOOM, (long)( nOld - SC_DELTA_ZOOM ) ); + nNew = Max( (long) MINZOOM, (long)round( nOld / ZOOM_FACTOR )); else - nNew = Min( (long) MAXZOOM, (long)( nOld + SC_DELTA_ZOOM ) ); + nNew = Min( (long) MAXZOOM, (long)round( nOld * ZOOM_FACTOR )); if ( nNew != nOld ) { diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index a5fdf313f11a..738aeec692f6 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -149,15 +149,14 @@ #include <string> #include <algorithm> +#include <svx/zoom_def.hxx> + #define SPLIT_MARGIN 30 #define SC_ICONSIZE 36 #define SC_SCROLLBAR_MIN 30 #define SC_TABBAR_MIN 6 -// fuer Rad-Maus -#define SC_DELTA_ZOOM 10 - using namespace ::com::sun::star; // STATIC DATA ----------------------------------------------------------- @@ -1060,9 +1059,9 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos ) long nOld = (long)(( rOldY.GetNumerator() * 100 ) / rOldY.GetDenominator()); long nNew = nOld; if ( pData->GetDelta() < 0 ) - nNew = Max( (long) MINZOOM, (long)( nOld - SC_DELTA_ZOOM ) ); + nNew = Max( (long) MINZOOM, (long)round( nOld / ZOOM_FACTOR )); else - nNew = Min( (long) MAXZOOM, (long)( nOld + SC_DELTA_ZOOM ) ); + nNew = Min( (long) MAXZOOM, (long)round( nOld * ZOOM_FACTOR )); if ( nNew != nOld ) { |