From b34d9a2f1161362f049a4e380cc81acd3262bedd Mon Sep 17 00:00:00 2001 From: phkahler <14852918+phkahler@users.noreply.github.com> Date: Wed, 26 Jul 2023 18:08:02 -0400 Subject: [PATCH] Delete the partially drawn entity when ESC is pressed on pending operations by using UndoUndo() --- src/graphicswin.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/graphicswin.cpp b/src/graphicswin.cpp index 7033e772..65676255 100644 --- a/src/graphicswin.cpp +++ b/src/graphicswin.cpp @@ -1102,6 +1102,16 @@ void GraphicsWindow::MenuEdit(Command id) { } } } + // some pending operations need an Undo to properly clean up on ESC + if ( (SS.GW.pending.operation == Pending::DRAGGING_NEW_POINT) + || (SS.GW.pending.operation == Pending::DRAGGING_NEW_LINE_POINT) + || (SS.GW.pending.operation == Pending::DRAGGING_NEW_ARC_POINT) + || (SS.GW.pending.operation == Pending::DRAGGING_NEW_CUBIC_POINT) + || (SS.GW.pending.operation == Pending::DRAGGING_NEW_RADIUS) ) + { + SS.GW.ClearSuper(); + SS.UndoUndo(); + } SS.GW.ClearSuper(); SS.TW.HideEditControl(); SS.nakedEdges.Clear();