7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-20 21:11:43 +00:00

Ensure that new text objects are "new"

Setting the new object flag ensures that we do not commit changes in the
dialog, before the object is placed on the canvas

Fixes https://gitlab.com/kicad/code/kicad/issues/19778
This commit is contained in:
Seth Hillbrand 2025-01-28 23:15:48 -06:00
parent 46ada43166
commit 9beca90185

View File

@ -996,6 +996,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
text->SetLayer( layer );
text->SetAttributes( textAttrs );
text->SetTextPos( cursorPos );
text->SetFlags( IS_NEW ); // Prevent double undo commits
DIALOG_TEXT_PROPERTIES textDialog( m_frame, text );
bool cancelled;
@ -1168,7 +1169,7 @@ int DRAWING_TOOL::DrawTable( const TOOL_EVENT& aEvent )
COORDS_PADDING );
m_controls->ForceCursorPosition( true, cursorPos );
if( evt->IsCancelInteractive() || ( table && evt->IsAction( &ACTIONS::undo ) )
if( evt->IsCancelInteractive() || ( table && evt->IsAction( &ACTIONS::undo ) )
|| evt->IsDrag() )
{
if( table )