From 905fd63c9fb5139bd6eab644f8912df289444b4f Mon Sep 17 00:00:00 2001 From: mitxela Date: Thu, 21 Jan 2021 02:44:56 +0000 Subject: [PATCH] Fix autopanning behaviour for left-click-drag --- common/view/wx_view_controls.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/view/wx_view_controls.cpp b/common/view/wx_view_controls.cpp index 45b5e3adce..1304e594cd 100644 --- a/common/view/wx_view_controls.cpp +++ b/common/view/wx_view_controls.cpp @@ -191,7 +191,7 @@ void WX_VIEW_CONTROLS::onMotion( wxMouseEvent& aEvent ) int y = aEvent.GetY(); VECTOR2D mousePos( x, y ); - if( !aEvent.Dragging() && m_settings.m_grabMouse ) + if( m_state != DRAG_PANNING && m_state != DRAG_ZOOMING && m_settings.m_grabMouse ) { bool warp = false; wxSize parentSize = m_parentPanel->GetClientSize(); @@ -618,7 +618,8 @@ void WX_VIEW_CONTROLS::SetGrabMouse( bool aEnabled ) #if defined USE_MOUSE_CAPTURE if( aEnabled && !m_parentPanel->HasCapture() ) m_parentPanel->CaptureMouse(); - else if( !aEnabled && m_parentPanel->HasCapture() && m_state == IDLE ) + else if( !aEnabled && m_parentPanel->HasCapture() + && m_state != DRAG_PANNING && m_state != DRAG_ZOOMING ) m_parentPanel->ReleaseMouse(); #endif