From c3190627e28fa639a1ca999241075a92c2360289 Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Wed, 13 Jan 2021 19:56:09 +0000 Subject: [PATCH] pl-editor: Don't update the properties panel while adding an text item Fixes https://gitlab.com/kicad/code/kicad/-/issues/7074 --- pagelayout_editor/tools/pl_drawing_tools.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pagelayout_editor/tools/pl_drawing_tools.cpp b/pagelayout_editor/tools/pl_drawing_tools.cpp index 2fa39462b2..4992e96815 100644 --- a/pagelayout_editor/tools/pl_drawing_tools.cpp +++ b/pagelayout_editor/tools/pl_drawing_tools.cpp @@ -161,7 +161,10 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent ) item = dataItem->GetDrawItems()[0]; item->SetFlags( IS_NEW | IS_MOVED ); - m_selectionTool->AddItemToSel( item ); + + // Select the item but don't inform other tools (to prevent the Properties + // panel from updating the item before it has been placed) + m_selectionTool->AddItemToSel( item, true ); // update the cursor so it looks correct before another event setCursor(); @@ -175,6 +178,11 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent ) item->ClearEditFlags(); getView()->Update( item ); + // Now we re-select and inform other tools, so that the Properties panel + // is updated. + m_toolMgr->RunAction( PL_ACTIONS::clearSelection, true ); + m_selectionTool->AddItemToSel( item, false ); + item = nullptr; m_frame->OnModify();