diff options
author | Tim Hardeck <thardeck@suse.com> | 2012-01-18 16:42:55 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2012-01-25 12:35:54 +0100 |
commit | 315d2ddc161e4b296febe9e54c3cfc9270310bfe (patch) | |
tree | dbf07bd17f430ef980074f27f5a540a34abea5c5 /sw | |
parent | 554bcf4205ede6ec3adb9f39e676b77054b1e8a1 (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 'sw')
-rw-r--r-- | sw/source/ui/uiview/viewport.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx index e6300872c498..ae6ef2046439 100644 --- a/sw/source/ui/uiview/viewport.cxx +++ b/sw/source/ui/uiview/viewport.cxx @@ -52,8 +52,7 @@ #include <IDocumentSettingAccess.hxx> -#include <svx/zoom_def.hxx> -#include <rtl/math.hxx> +#include <basegfx/tools/zoomtools.hxx> //Das SetVisArea der DocShell darf nicht vom InnerResizePixel gerufen werden. //Unsere Einstellungen muessen aber stattfinden. @@ -1312,9 +1311,9 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent& rCEvt ) { sal_uInt16 nFact = pWrtShell->GetViewOptions()->GetZoom(); if( 0L > pWData->GetDelta() ) - nFact = static_cast< sal_uInt16 >(Max( 20, (int)::rtl::math::round( nFact / ZOOM_FACTOR ))); + nFact = static_cast< sal_uInt16 >(Max( 20, basegfx::zoomtools::zoomOut( nFact ))); else - nFact = static_cast< sal_uInt16 >(Min( 600, (int)::rtl::math::round( nFact * ZOOM_FACTOR ))); + nFact = static_cast< sal_uInt16 >(Min( 600, basegfx::zoomtools::zoomIn( nFact ))); SetZoom( SVX_ZOOM_PERCENT, nFact ); bOk = sal_True; |