Bug #1202761 (Off centre zoom )

This commit is contained in:
jean-pierre charras 2013-07-22 20:38:04 +02:00
parent b65c7df0a3
commit ec7ee344b5
1 changed files with 5 additions and 3 deletions

View File

@ -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 );