pl-editor: Don't update the properties panel while adding a shape item (line or rectangle)

Fixes a bug that caused a crash when editing an item in the properties window before it was fully created
This commit is contained in:
Roberto Fernandez Bautista 2021-01-14 18:47:11 +00:00 committed by Jon Evans
parent c3190627e2
commit c7624d2957
1 changed files with 9 additions and 1 deletions

View File

@ -284,10 +284,18 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
item = dataItem->GetDrawItems()[0];
item->SetFlags( IS_NEW );
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 );
}
else // finish drawing
{
// 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->ClearEditFlags();
item = nullptr;
m_toolMgr->RunAction( ACTIONS::activatePointEditor );