From 7dbd92091278d1a53722aaa5cd422d1c83ce8593 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 6 Mar 2023 14:30:58 +0000 Subject: [PATCH] Don't allow footprint editor pad tools to run outside footprint editor. (They can get called if a user re-assigns hotkeys to them.) Fixes https://gitlab.com/kicad/code/kicad/issues/14166 --- pcbnew/tools/pad_tool.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pcbnew/tools/pad_tool.cpp b/pcbnew/tools/pad_tool.cpp index 5045741060..284c49cbb4 100644 --- a/pcbnew/tools/pad_tool.cpp +++ b/pcbnew/tools/pad_tool.cpp @@ -282,6 +282,9 @@ int PAD_TOOL::pushPadSettings( const TOOL_EVENT& aEvent ) int PAD_TOOL::EnumeratePads( const TOOL_EVENT& aEvent ) { + if( !m_isFootprintEditor ) + return 0; + if( !board()->GetFirstFootprint() || board()->GetFirstFootprint()->Pads().empty() ) return 0; @@ -491,6 +494,9 @@ int PAD_TOOL::EnumeratePads( const TOOL_EVENT& aEvent ) int PAD_TOOL::PlacePad( const TOOL_EVENT& aEvent ) { + if( !m_isFootprintEditor ) + return 0; + if( !board()->GetFirstFootprint() ) return 0; @@ -571,6 +577,9 @@ int PAD_TOOL::PlacePad( const TOOL_EVENT& aEvent ) int PAD_TOOL::EditPad( const TOOL_EVENT& aEvent ) { + if( !m_isFootprintEditor ) + return 0; + PCB_DISPLAY_OPTIONS opts = frame()->GetDisplayOptions(); PCB_RENDER_SETTINGS* settings = static_cast( view()->GetPainter()->GetSettings() ); WX_INFOBAR* infoBar = frame()->GetInfoBar();