From daa035870af2bfdb609eb29f0ec1e7d05b48012e Mon Sep 17 00:00:00 2001 From: carlopav Date: Sat, 24 Aug 2019 15:35:14 +0200 Subject: [PATCH] [Draft] Edit: fixed bug with dimensions Update function always receive global vector as target of the transformation. --- src/Mod/Draft/DraftEdit.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Mod/Draft/DraftEdit.py b/src/Mod/Draft/DraftEdit.py index fb847b91cc..bcf2d5f223 100644 --- a/src/Mod/Draft/DraftEdit.py +++ b/src/Mod/Draft/DraftEdit.py @@ -681,15 +681,14 @@ class Edit(): elif objectType == "Part::Line" and obj.TypeId == "Part::Line": self.setPartLinePts() + def update(self,v): "apply the vector to the modified point and update self.obj" - localVector = self.invpl.multVec(v) #subtract placement from edit vector, to be completed - FreeCAD.ActiveDocument.openTransaction("Edit") - if Draft.getType(self.obj) in ["Wire","BSpline"]: self.updateWire(localVector) - elif Draft.getType(self.obj) == "BezCurve": self.updateWire(localVector) + if Draft.getType(self.obj) in ["Wire","BSpline"]: self.updateWire(v) + elif Draft.getType(self.obj) == "BezCurve": self.updateWire(v) elif Draft.getType(self.obj) == "Circle": self.updateCircle(v) elif Draft.getType(self.obj) == "Rectangle": self.updateRectangle(v) elif Draft.getType(self.obj) == "Polygon": self.updatePolygon(v) @@ -721,7 +720,7 @@ class Edit(): def updateWire(self,v): pts = self.obj.Points - editPnt = v#self.invpl.multVec(v) + editPnt = self.invpl.multVec(v) # DNC: allows to close the curve by placing ends close to each other tol = 0.001 if ( ( self.editing == 0 ) and ( (editPnt - pts[-1]).Length < tol) ) or ( self.editing == len(pts) - 1 ) and ( (editPnt - pts[0]).Length < tol):