From 85269351839c360087c3c811b33f7d4704504ba9 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 1 Mar 2017 13:00:42 +0100 Subject: [PATCH] GAL: better progression between zoom in/zoom out (in/out/in sequence keeps the same zoom value) --- common/tool/common_tools.cpp | 4 ++-- common/view/wx_view_controls.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/tool/common_tools.cpp b/common/tool/common_tools.cpp index b5b7b07b88..46965291d6 100644 --- a/common/tool/common_tools.cpp +++ b/common/tool/common_tools.cpp @@ -58,7 +58,7 @@ int COMMON_TOOLS::ZoomInOut( const TOOL_EVENT& aEvent ) if( aEvent.IsAction( &ACTIONS::zoomIn ) ) zoomScale = 1.3; else if( aEvent.IsAction( &ACTIONS::zoomOut ) ) - zoomScale = 0.7; + zoomScale = 1/1.3; view->SetScale( view->GetScale() * zoomScale, getViewControls()->GetCursorPosition() ); @@ -77,7 +77,7 @@ int COMMON_TOOLS::ZoomInOutCenter( const TOOL_EVENT& aEvent ) if( aEvent.IsAction( &ACTIONS::zoomInCenter ) ) zoomScale = 1.3; else if( aEvent.IsAction( &ACTIONS::zoomOutCenter ) ) - zoomScale = 0.7; + zoomScale = 1/1.3; view->SetScale( view->GetScale() * zoomScale ); diff --git a/common/view/wx_view_controls.cpp b/common/view/wx_view_controls.cpp index c651880f43..bb10462ba6 100644 --- a/common/view/wx_view_controls.cpp +++ b/common/view/wx_view_controls.cpp @@ -169,7 +169,7 @@ void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& aEvent ) } else { - zoomScale = ( rotation > 0 ) ? 1.05 : 0.95; + zoomScale = ( rotation > 0 ) ? 1.05 : 1/1.05; } if( IsCursorWarpingEnabled() )