From 538ee121880acb393219fb61e2429d604f3f2b0c Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 9 Feb 2023 16:29:33 +0100 Subject: [PATCH] Pcb editor: fix crash when trying to activate the "place anchor" tool. "place anchor" tool exists only in the Fp editor. However, the hotkey to activate this tool was also active in the board editor. Now disabled. --- pcbnew/tools/drawing_tool.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 8ed44c3e9a..253be2fdf2 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2014-2017 CERN - * Copyright (C) 2018-2022 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2018-2023 KiCad Developers, see AUTHORS.txt for contributors. * @author Maciej Suminski * * This program is free software; you can redistribute it and/or @@ -1682,7 +1682,9 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent ) int DRAWING_TOOL::SetAnchor( const TOOL_EVENT& aEvent ) { - wxASSERT( m_isFootprintEditor ); + // Make sense only in FP editor + if( !m_isFootprintEditor ) + return 0; if( !m_frame->GetModel() ) return 0;