Merge pull request #4927 from marioalexis84/draft-restore
Draft: Fix regression on WP and fixes #0004562
This commit is contained in:
@@ -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()
|
||||
## @}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user