From ba4a7a979a9012b22aad3ccb303ce78ac19e9a34 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 24 Dec 2022 19:39:57 +0000 Subject: [PATCH] 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 --- eeschema/tools/sch_drawing_tools.cpp | 16 +++++++++++++++- eeschema/tools/sch_move_tool.cpp | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index 828ae22d47..d5a8890ade 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -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 ); diff --git a/eeschema/tools/sch_move_tool.cpp b/eeschema/tools/sch_move_tool.cpp index b865e52a89..a9deec86fc 100644 --- a/eeschema/tools/sch_move_tool.cpp +++ b/eeschema/tools/sch_move_tool.cpp @@ -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; }