Commit ec7ee344 authored by jean-pierre charras's avatar jean-pierre charras

Bug #1202761 (Off centre zoom )

parent b65c7df0
...@@ -881,6 +881,9 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event ) ...@@ -881,6 +881,9 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event )
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetEventObject( this ); cmd.SetEventObject( this );
bool offCenterReq = event.ControlDown() && event.ShiftDown();
offCenterReq = offCenterReq || m_enableZoomNoCenter;
// This is a zoom in or out command // This is a zoom in or out command
if( event.GetWheelRotation() > 0 ) if( event.GetWheelRotation() > 0 )
{ {
...@@ -888,8 +891,7 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event ) ...@@ -888,8 +891,7 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event )
cmd.SetId( ID_PAN_UP ); cmd.SetId( ID_PAN_UP );
else if( event.ControlDown() && !event.ShiftDown() ) else if( event.ControlDown() && !event.ShiftDown() )
cmd.SetId( ID_PAN_LEFT ); cmd.SetId( ID_PAN_LEFT );
else if( (event.ControlDown() && event.ShiftDown() ) else if( offCenterReq )
|| m_enableZoomNoCenter)
cmd.SetId( ID_OFFCENTER_ZOOM_IN ); cmd.SetId( ID_OFFCENTER_ZOOM_IN );
else else
cmd.SetId( ID_POPUP_ZOOM_IN ); cmd.SetId( ID_POPUP_ZOOM_IN );
...@@ -900,7 +902,7 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event ) ...@@ -900,7 +902,7 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event )
cmd.SetId( ID_PAN_DOWN ); cmd.SetId( ID_PAN_DOWN );
else if( event.ControlDown() && !event.ShiftDown() ) else if( event.ControlDown() && !event.ShiftDown() )
cmd.SetId( ID_PAN_RIGHT ); cmd.SetId( ID_PAN_RIGHT );
else if( event.AltDown() || m_enableZoomNoCenter) else if( offCenterReq )
cmd.SetId( ID_OFFCENTER_ZOOM_OUT ); cmd.SetId( ID_OFFCENTER_ZOOM_OUT );
else else
cmd.SetId( ID_POPUP_ZOOM_OUT ); cmd.SetId( ID_POPUP_ZOOM_OUT );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment