From ec7ee344b50faeb06570fe4f6187b04a3f26e966 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 22 Jul 2013 20:38:04 +0200 Subject: [PATCH] Bug #1202761 (Off centre zoom ) --- common/drawpanel.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/drawpanel.cpp b/common/drawpanel.cpp index 7494d61a5c..1e47b8e8c5 100644 --- a/common/drawpanel.cpp +++ b/common/drawpanel.cpp @@ -881,6 +881,9 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event ) wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); cmd.SetEventObject( this ); + bool offCenterReq = event.ControlDown() && event.ShiftDown(); + offCenterReq = offCenterReq || m_enableZoomNoCenter; + // This is a zoom in or out command if( event.GetWheelRotation() > 0 ) { @@ -888,8 +891,7 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event ) cmd.SetId( ID_PAN_UP ); else if( event.ControlDown() && !event.ShiftDown() ) cmd.SetId( ID_PAN_LEFT ); - else if( (event.ControlDown() && event.ShiftDown() ) - || m_enableZoomNoCenter) + else if( offCenterReq ) cmd.SetId( ID_OFFCENTER_ZOOM_IN ); else cmd.SetId( ID_POPUP_ZOOM_IN ); @@ -900,7 +902,7 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event ) cmd.SetId( ID_PAN_DOWN ); else if( event.ControlDown() && !event.ShiftDown() ) cmd.SetId( ID_PAN_RIGHT ); - else if( event.AltDown() || m_enableZoomNoCenter) + else if( offCenterReq ) cmd.SetId( ID_OFFCENTER_ZOOM_OUT ); else cmd.SetId( ID_POPUP_ZOOM_OUT );