diff --git a/common/view/wx_view_controls.cpp b/common/view/wx_view_controls.cpp index da1ee6dfae..c12cd8f729 100644 --- a/common/view/wx_view_controls.cpp +++ b/common/view/wx_view_controls.cpp @@ -369,28 +369,25 @@ void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& aEvent ) // Restrict zoom handling to the vertical axis, otherwise horizontal // scrolling events (e.g. touchpads and some mice) end up interpreted // as vertical scroll events and confuse the user. - if( modifiers == m_settings.m_scrollModifierZoom ) + if( modifiers == m_settings.m_scrollModifierZoom && axis == wxMOUSE_WHEEL_VERTICAL ) { - if ( axis == wxMOUSE_WHEEL_VERTICAL ) - { - const int rotation = aEvent.GetWheelRotation(); - const double zoomScale = m_zoomController->GetScaleForRotation( rotation ); - - if( IsCursorWarpingEnabled() ) - { - CenterOnCursor(); - m_view->SetScale( m_view->GetScale() * zoomScale ); - } - else - { - const VECTOR2D anchor = m_view->ToWorld( VECTOR2D( aEvent.GetX(), aEvent.GetY() ) ); - m_view->SetScale( m_view->GetScale() * zoomScale, anchor ); - } + const int rotation = aEvent.GetWheelRotation(); + const double zoomScale = m_zoomController->GetScaleForRotation( rotation ); - // Refresh the zoom level and mouse position on message panel - // (mouse position has not changed, only the zoom level has changed): - refreshMouse( true ); + if( IsCursorWarpingEnabled() ) + { + CenterOnCursor(); + m_view->SetScale( m_view->GetScale() * zoomScale ); + } + else + { + const VECTOR2D anchor = m_view->ToWorld( VECTOR2D( aEvent.GetX(), aEvent.GetY() ) ); + m_view->SetScale( m_view->GetScale() * zoomScale, anchor ); } + + // Refresh the zoom level and mouse position on message panel + // (mouse position has not changed, only the zoom level has changed): + refreshMouse( true ); } else {