Possible fix for move/esc/esc crash.
Fixes https://gitlab.com/kicad/code/kicad/issues/12553
This commit is contained in:
parent
11e20e52e9
commit
ba630971af
|
@ -997,6 +997,11 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, bool aPickReference )
|
||||||
// Discard reference point when selection is "dropped" onto the board
|
// Discard reference point when selection is "dropped" onto the board
|
||||||
selection.ClearReferencePoint();
|
selection.ClearReferencePoint();
|
||||||
|
|
||||||
|
// Unselect all items to clear selection flags and then re-select the originally selected
|
||||||
|
// items.
|
||||||
|
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
|
||||||
|
m_toolMgr->RunAction( PCB_ACTIONS::selectItems, true, &orig_items );
|
||||||
|
|
||||||
// TODO: there's an encapsulation leak here: this commit often has more than just the move
|
// TODO: there's an encapsulation leak here: this commit often has more than just the move
|
||||||
// in it; for instance it might have a paste, append board, etc. as well.
|
// in it; for instance it might have a paste, append board, etc. as well.
|
||||||
if( restore_state )
|
if( restore_state )
|
||||||
|
@ -1007,11 +1012,6 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, bool aPickReference )
|
||||||
// Remove the dynamic ratsnest from the screen
|
// Remove the dynamic ratsnest from the screen
|
||||||
m_toolMgr->RunAction( PCB_ACTIONS::hideLocalRatsnest, true );
|
m_toolMgr->RunAction( PCB_ACTIONS::hideLocalRatsnest, true );
|
||||||
|
|
||||||
// Unselect all items to clear selection flags and then re-select the originally selected
|
|
||||||
// items.
|
|
||||||
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
|
|
||||||
m_toolMgr->RunAction( PCB_ACTIONS::selectItems, true, &orig_items );
|
|
||||||
|
|
||||||
editFrame->PopTool( aEvent );
|
editFrame->PopTool( aEvent );
|
||||||
editFrame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
|
editFrame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue