Skip to content

Commit

Permalink
Draft: PlaneGui: minor fixes (FreeCAD#11115)
Browse files Browse the repository at this point in the history
Related issue:
FreeCAD#5603.

* An 'auto' WP should not be added to the history if the previous WP in the history is also 'auto'.
* The `get_working_plane` function should only call `set_to_default` if the GUI is up. The axis of the returned WP should match global +Z if the GUI is not up.
  • Loading branch information
Roy-043 authored Oct 20, 2023
1 parent 5a6cfaf commit 345df4b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Mod/Draft/WorkingPlane.py
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,8 @@ def _update_history(self):
return
if data == self._history["data_list"][-1]:
return
if self.auto is True and self._history["data_list"][-1]["auto"] is True:
return

max_len = 10 # Max. length of data_list.
idx = self._history["idx"]
Expand Down Expand Up @@ -1747,12 +1749,12 @@ def get_working_plane(update=True):
return wp

wp = PlaneGui()
wp._view = view
wp.set_to_default()

if view is not None:
FreeCAD.draft_working_planes[0].append(view)
FreeCAD.draft_working_planes[1].append(wp)
if FreeCAD.GuiUp:
wp.set_to_default()
wp._view = view
if view is not None:
FreeCAD.draft_working_planes[0].append(view)
FreeCAD.draft_working_planes[1].append(wp)

return wp

Expand Down

0 comments on commit 345df4b

Please sign in to comment.