[TD]fix location of CV on rotated views

This commit is contained in:
wandererfan
2023-12-22 11:12:10 -05:00
committed by WandererFan
parent 2fe19267df
commit e6517089df
12 changed files with 155 additions and 69 deletions

View File

@@ -28,6 +28,7 @@ __date__ = "2023/12/04"
import FreeCAD as App
import FreeCADGui as Gui
import TechDraw
from functools import partial
@@ -47,12 +48,17 @@ class TaskAddOffsetVertex():
def accept(self):
'''slot: OK pressed'''
point = self.vertex.Point
point = self.vertex.Point # this is unscaled and inverted, but is also rotated.
# unrotate point. Note that since this is already unscaled, we need to set the
# third parameter to False to avoid an extra descaling.
point = TechDraw.makeCanonicalPoint(self.view, point, False);
xOffset = self.form.dSpinBoxX.value()
yOffset = self.form.dSpinBoxY.value()
offset = App.Vector(xOffset,yOffset,0)
offset = App.Vector(xOffset,yOffset,0) # the offset is applied to the canonical
# point. it is an unscaled, unrotated,
# uninverted relative value.
self.view.makeCosmeticVertex(point+offset)
Gui.Control.closeDialog()
def reject(self):
return True
return True