Pcbnew: Fix bug when mouse moves off clarification menu

CHANGED: This code fixes an issue where bringing up the clarification
menu and moving off it while keeping the button pressed the entire
time caused an assertion.

Fixes https://gitlab.com/kicad/code/kicad/issues/5250
This commit is contained in:
PJM 2020-08-22 16:48:19 -07:00
parent c71bb246e6
commit dd374e12ad
1 changed files with 4 additions and 2 deletions

View File

@ -281,8 +281,10 @@ int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
if( m_selection.Empty() && selectCursor() )
m_selection.SetIsHover( true );
// Check if dragging has started within any of selected items bounding box
if( selectionContains( evt->Position() ) )
// Check if dragging has started within any of selected items bounding box.
// We verify "HasPosition()" first to protect against edge case involving
// moving off menus that causes problems (issue #5250)
if( evt->HasPosition() && selectionContains( evt->Position() ) )
{
// Yes -> run the move tool and wait till it finishes
TRACK* track = dynamic_cast<TRACK*>( m_selection.GetItem( 0 ) );