More logical implementation of the fix.

This commit is contained in:
Roy-043
2024-10-07 11:18:58 +02:00
committed by Yorik van Havre
parent 6ccca8b9ad
commit 1dd4fd636c

View File

@@ -143,9 +143,8 @@ class DraftTaskPanel:
# https://github.com/FreeCAD/FreeCAD/issues/17027
# Function can be called multiple times if Esc is pressed during mouse
# move. We need to prevent multiple calls to draftToolBar.escape():
if getattr(FreeCAD, "activeDraftCommand", None) is None:
if not FreeCADGui.draftToolBar.isTaskOn:
return
FreeCAD.activeDraftCommand = None
FreeCADGui.draftToolBar.isTaskOn = False
FreeCADGui.draftToolBar.escape()
if FreeCADGui.ActiveDocument: