Don't continue until the move tool completes
Starting a new action (to add junctions) will break the move tool loop and cancel placement. We need to wait until the tool completes before choosing where to place the junctions Fixes https://gitlab.com/kicad/code/kicad/issues/7421
This commit is contained in:
parent
016bffc899
commit
2aa8a3724f
|
@ -959,15 +959,25 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent )
|
|||
m_selectionTool->AddItemToSel( newItem );
|
||||
|
||||
if( performDrag )
|
||||
{
|
||||
m_toolMgr->RunAction( EE_ACTIONS::move, true );
|
||||
|
||||
SCH_MOVE_TOOL* moveTool = m_toolMgr->GetTool<SCH_MOVE_TOOL>();
|
||||
|
||||
// We cannot proceed until the move tool has ended (by placement or cancel) otherwise,
|
||||
// we risk breaking out of the tool by activating another
|
||||
while( moveTool->IsToolActive() )
|
||||
Wait();
|
||||
}
|
||||
|
||||
newItem->ClearFlags();
|
||||
|
||||
if( newItem->IsConnectable() )
|
||||
{
|
||||
auto selection = m_selectionTool->GetSelection();
|
||||
EE_SELECTION new_sel = m_selectionTool->GetSelection();
|
||||
new_sel.Add( newItem );
|
||||
|
||||
m_toolMgr->RunAction( EE_ACTIONS::addNeededJunctions, true, &selection );
|
||||
m_toolMgr->RunAction( EE_ACTIONS::addNeededJunctions, true, &new_sel );
|
||||
m_frame->SchematicCleanUp();
|
||||
m_frame->TestDanglingEnds();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue