Cancel drag action when focus is lost
This commit is contained in:
parent
bb79eb0e45
commit
886cad43bd
|
@ -545,6 +545,8 @@ void EDA_DRAW_PANEL_GAL::onLostFocus( wxFocusEvent& aEvent )
|
|||
{
|
||||
m_lostFocus = true;
|
||||
|
||||
m_viewControls->CancelDrag();
|
||||
|
||||
aEvent.Skip();
|
||||
}
|
||||
|
||||
|
|
|
@ -598,6 +598,19 @@ void WX_VIEW_CONTROLS::CaptureCursor( bool aEnabled )
|
|||
}
|
||||
|
||||
|
||||
void WX_VIEW_CONTROLS::CancelDrag()
|
||||
{
|
||||
if( m_state == DRAG_PANNING || m_state == DRAG_ZOOMING )
|
||||
{
|
||||
m_state = IDLE;
|
||||
#if defined USE_MOUSE_CAPTURE
|
||||
if( !m_settings.m_cursorCaptured && m_parentPanel->HasCapture() )
|
||||
m_parentPanel->ReleaseMouse();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
VECTOR2D WX_VIEW_CONTROLS::GetMousePosition( bool aWorldCoordinates ) const
|
||||
{
|
||||
wxPoint msp = getMouseScreenPosition();
|
||||
|
|
|
@ -102,6 +102,9 @@ public:
|
|||
///< Adjusts the scrollbars position to match the current viewport.
|
||||
void UpdateScrollbars();
|
||||
|
||||
///< End any mouse drag action still in progress
|
||||
void CancelDrag();
|
||||
|
||||
void ForceCursorPosition( bool aEnabled,
|
||||
const VECTOR2D& aPosition = VECTOR2D( 0, 0 ) ) override;
|
||||
|
||||
|
|
Loading…
Reference in New Issue