Merge pull request #4927 from marioalexis84/draft-restore

Draft: Fix regression on WP and fixes #0004562
This commit is contained in:
Yorik van Havre
2021-08-02 15:52:42 +02:00
committed by GitHub
2 changed files with 9 additions and 1 deletions

View File

@@ -180,6 +180,7 @@ class DraftTool:
self.ui.sourceCmd = None
if self.planetrack:
self.planetrack.finalize()
App.DraftWorkingPlane.restore()
if hasattr(Gui, "Snapper"):
Gui.Snapper.off()
if self.call:
@@ -302,4 +303,9 @@ class Modifier(DraftTool):
super(Modifier, self).__init__()
self.copymode = False
def Activated(self, name="None", noplanesetup=False, is_subtool=False):
super(Modifier, self).Activated(name, noplanesetup, is_subtool)
# call DraftWorkingPlane.save to sync with
# DraftWorkingPlane.restore called in finish method
App.DraftWorkingPlane.save()
## @}

View File

@@ -127,6 +127,9 @@ class Draft_SelectPlane:
self.taskd.form.fieldGridExtension.valueChanged.connect(self.onSetExtension)
self.taskd.form.fieldSnapRadius.valueChanged.connect(self.onSetSnapRadius)
# save previous WP to ensure back to the last used when restored
FreeCAD.DraftWorkingPlane.save()
# Try to find a WP from the current selection
if FreeCADGui.Selection.getSelectionEx(FreeCAD.ActiveDocument.Name):
if self.handle():
@@ -161,7 +164,6 @@ class Draft_SelectPlane:
# Reset everything else
FreeCADGui.Control.closeDialog()
FreeCAD.DraftWorkingPlane.restore()
FreeCADGui.ActiveDocument.resetEdit()
return True