Skip to content

Commit

Permalink
Merge pull request FreeCAD#11902 from Roy-043/Draft-gui_snapper-setTr…
Browse files Browse the repository at this point in the history
…ackers-can-be-called-if-there-is-no-3D-view

Draft: gui_snapper: setTrackers can be called if there is no 3D view
  • Loading branch information
Roy-043 authored Jan 5, 2024
2 parents 1d2186b + 0b036ab commit 6d7df1d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Mod/Draft/draftguitools/gui_snapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1569,14 +1569,15 @@ def hide(self):
def setGrid(self):
"""Set the grid, if visible."""
self.setTrackers()
if self.grid.Visible:
self.grid.set()


def setTrackers(self, update_grid=True):
"""Set the trackers."""
v = Draft.get3DView()
if v and (v != self.activeview):
if v is None:
return

if v != self.activeview:
if v in self.trackers[0]:
i = self.trackers[0].index(v)
self.grid = self.trackers[1][i]
Expand Down

0 comments on commit 6d7df1d

Please sign in to comment.