Draft: gui_snapper: setTrackers can be called if there is no 3D view

This commit is contained in:
Roy-043
2024-01-05 10:50:46 +01:00
parent 1d2186b7d6
commit 0b036ab58a

View File

@@ -1569,14 +1569,15 @@ class Snapper:
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]