Disable positioning tools when a move is in progress.

Also fixes a typo in EDIT_TOOL::doMoveSelection().

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15090
This commit is contained in:
Jeff Young
2023-06-30 20:37:03 +01:00
parent 821f365758
commit 7ed5963b4f
2 changed files with 18 additions and 20 deletions
+11 -7
View File
@@ -91,10 +91,16 @@ POSITIONING_TOOLS_MENU::POSITIONING_TOOLS_MENU( TOOL_INTERACTIVE* aTool ) :
SetIcon( BITMAPS::special_tools );
SetTitle( _( "Positioning Tools" ) );
AddItem( PCB_ACTIONS::moveExact, SELECTION_CONDITIONS::ShowAlways );
AddItem( PCB_ACTIONS::moveWithReference, SELECTION_CONDITIONS::ShowAlways );
AddItem( PCB_ACTIONS::copyWithReference, SELECTION_CONDITIONS::ShowAlways );
AddItem( PCB_ACTIONS::positionRelative, SELECTION_CONDITIONS::ShowAlways );
auto notMovingCondition =
[ this ]( const SELECTION& aSelection )
{
return aSelection.Empty() || !aSelection.Front()->IsMoving();
};
AddItem( PCB_ACTIONS::moveExact, SELECTION_CONDITIONS::NotEmpty && notMovingCondition );
AddItem( PCB_ACTIONS::moveWithReference, SELECTION_CONDITIONS::NotEmpty && notMovingCondition );
AddItem( PCB_ACTIONS::copyWithReference, SELECTION_CONDITIONS::NotEmpty && notMovingCondition );
AddItem( PCB_ACTIONS::positionRelative, SELECTION_CONDITIONS::NotEmpty && notMovingCondition );
}
@@ -165,9 +171,7 @@ bool EDIT_TOOL::Init()
auto notMovingCondition =
[ this ]( const SELECTION& aSelection )
{
return !frame()->IsCurrentTool( PCB_ACTIONS::move )
&& !frame()->IsCurrentTool( PCB_ACTIONS::moveWithReference )
&& !frame()->IsCurrentTool( PCB_ACTIONS::moveIndividually );
return aSelection.Empty() || !aSelection.Front()->IsMoving();
};
auto noItemsCondition =