From 8b124b659cda8bb1868d37d9b6533c099b3e5232 Mon Sep 17 00:00:00 2001 From: Roy-043 Date: Fri, 7 Feb 2025 13:38:56 +0100 Subject: [PATCH] Draft: Fix line length input issue Fixes #19451. --- src/Mod/Draft/draftobjects/wire.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Mod/Draft/draftobjects/wire.py b/src/Mod/Draft/draftobjects/wire.py index 561e4ffdd3..f0ead02b15 100644 --- a/src/Mod/Draft/draftobjects/wire.py +++ b/src/Mod/Draft/draftobjects/wire.py @@ -231,14 +231,11 @@ class Wire(DraftObject): obj.Points = pts elif prop == "Length": - if (len(obj.Points) == 2 - and obj.Length.Value > tol - and obj.Shape - and (not obj.Shape.isNull()) - and abs(obj.Length.Value - obj.Shape.Length) > tol): - v = obj.Points[-1].sub(obj.Points[0]) - v = DraftVecUtils.scaleTo(v, obj.Length.Value) - obj.Points = [obj.Points[0], obj.Points[0].add(v)] + if len(obj.Points) == 2 and obj.Length.Value > tol: + vec = obj.Points[-1].sub(obj.Points[0]) + if abs(obj.Length.Value - vec.Length) > tol: + vec = DraftVecUtils.scaleTo(vec, obj.Length.Value) + obj.Points = [obj.Points[0], obj.Points[0].add(vec)] def update_start_end(self, obj): tol = 1e-7