Draft: Fixed ghosts vanishing when using mouse delay - issue #12624 (#14358)

This commit is contained in:
Yorik van Havre
2024-05-30 22:41:54 +02:00
committed by GitHub
parent 5ac615a9c5
commit bf1d579724
2 changed files with 23 additions and 18 deletions

View File

@@ -142,9 +142,13 @@ class Move(gui_base_original.Modifier):
self.point, ctrlPoint, info = gui_tool_utils.getPoint(self, arg)
if len(self.node) > 0:
last = self.node[len(self.node) - 1]
self.vector = self.point.sub(last)
if self.point:
self.vector = self.point.sub(last)
else:
self.vector = None
for ghost in self.ghosts:
ghost.move(self.vector)
if self.vector:
ghost.move(self.vector)
ghost.on()
if self.extendedCopy:
if not gui_tool_utils.hasMod(arg, gui_tool_utils.get_mod_alt_key()):

View File

@@ -124,7 +124,7 @@ class Rotate(gui_base_original.Modifier):
ghost.off()
self.point, ctrlPoint, info = gui_tool_utils.getPoint(self, arg)
# this is to make sure radius is what you see on screen
if self.center and DraftVecUtils.dist(self.point, self.center):
if self.center and self.point and DraftVecUtils.dist(self.point, self.center):
viewdelta = DraftVecUtils.project(self.point.sub(self.center),
self.wp.axis)
if not DraftVecUtils.isNull(viewdelta):
@@ -136,32 +136,33 @@ class Rotate(gui_base_original.Modifier):
if self.step == 0:
pass
elif self.step == 1:
currentrad = DraftVecUtils.dist(self.point, self.center)
if currentrad != 0:
angle = DraftVecUtils.angle(self.wp.u,
self.point.sub(self.center),
self.wp.axis)
else:
angle = 0
angle = 0
if self.point:
currentrad = DraftVecUtils.dist(self.point, self.center)
if currentrad != 0:
angle = DraftVecUtils.angle(self.wp.u,
self.point.sub(self.center),
self.wp.axis)
self.ui.setRadiusValue(math.degrees(angle), unit="Angle")
self.firstangle = angle
self.ui.radiusValue.setFocus()
self.ui.radiusValue.selectAll()
elif self.step == 2:
currentrad = DraftVecUtils.dist(self.point, self.center)
if currentrad != 0:
angle = DraftVecUtils.angle(self.wp.u,
self.point.sub(self.center),
self.wp.axis)
else:
angle = 0
angle = 0
if self.point:
currentrad = DraftVecUtils.dist(self.point, self.center)
if currentrad != 0:
angle = DraftVecUtils.angle(self.wp.u,
self.point.sub(self.center),
self.wp.axis)
if angle < self.firstangle:
sweep = (2 * math.pi - self.firstangle) + angle
else:
sweep = angle - self.firstangle
self.arctrack.setApertureAngle(sweep)
for ghost in self.ghosts:
ghost.rotate(self.wp.axis, sweep)
if sweep:
ghost.rotate(self.wp.axis, sweep)
ghost.on()
self.ui.setRadiusValue(math.degrees(sweep), 'Angle')
self.ui.radiusValue.setFocus()