Don't respond to Duplicate events while placing multiple copies of a symbol.

It doesn't really make any sense as clicking will just create another copy
as well.

Fixes https://gitlab.com/kicad/code/kicad/issues/13253
This commit is contained in:
Jeff Young 2022-12-24 19:39:57 +00:00
parent 5dce8323e8
commit ba4a7a979a
2 changed files with 16 additions and 1 deletions

View File

@ -301,7 +301,7 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
{
m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true );
// Pick the footprint to be placed
// Pick the symbol to be placed
bool footprintPreviews = m_frame->eeconfig()->m_Appearance.footprint_preview;
PICKED_SYMBOL sel = m_frame->PickSymbolFromLibTree( &filter, *historyList, true,
1, 1, footprintPreviews );
@ -412,6 +412,20 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
}
}
}
else if( evt->IsAction( &ACTIONS::duplicate ) )
{
if( symbol )
{
// This doesn't really make sense; we'll just end up dragging a stack of
// objects so we ignore the duplicate and just carry on.
wxBell();
continue;
}
// Exit. The duplicate will run in its own loop.
m_frame->PopTool( aEvent );
break;
}
else if( symbol && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) )
{
symbol->SetPosition( cursorPos );

View File

@ -790,6 +790,7 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
{
// This doesn't really make sense; we'll just end up dragging a stack of
// objects so we ignore the duplicate and just carry on.
wxBell();
continue;
}