Fix autopanning behaviour for left-click-drag

This commit is contained in:
mitxela 2021-01-21 02:44:56 +00:00 committed by Wayne Stambaugh
parent f7cd21c70d
commit 905fd63c9f
1 changed files with 3 additions and 2 deletions

View File

@ -191,7 +191,7 @@ void WX_VIEW_CONTROLS::onMotion( wxMouseEvent& aEvent )
int y = aEvent.GetY(); int y = aEvent.GetY();
VECTOR2D mousePos( x, y ); 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; bool warp = false;
wxSize parentSize = m_parentPanel->GetClientSize(); wxSize parentSize = m_parentPanel->GetClientSize();
@ -618,7 +618,8 @@ void WX_VIEW_CONTROLS::SetGrabMouse( bool aEnabled )
#if defined USE_MOUSE_CAPTURE #if defined USE_MOUSE_CAPTURE
if( aEnabled && !m_parentPanel->HasCapture() ) if( aEnabled && !m_parentPanel->HasCapture() )
m_parentPanel->CaptureMouse(); 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(); m_parentPanel->ReleaseMouse();
#endif #endif