From c84d1153ab61d94ad3372d0c0cea585542c76816 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 14 Nov 2023 15:31:07 +0200 Subject: [PATCH] Fix moving a point. First set angle then length. Length can have negative value. --- src/libs/vgeometry/vpointf.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libs/vgeometry/vpointf.cpp b/src/libs/vgeometry/vpointf.cpp index 0cb8ab5f6..b06901aa5 100644 --- a/src/libs/vgeometry/vpointf.cpp +++ b/src/libs/vgeometry/vpointf.cpp @@ -304,7 +304,9 @@ auto VPointF::FlipPF(const QLineF &axis, const QPointF &point) -> QPointF //--------------------------------------------------------------------------------------------------------------------- auto VPointF::MovePF(const QPointF &originPoint, qreal length, qreal angle) -> QPointF { - QLineF line(originPoint.x(), originPoint.y(), originPoint.x() + length, originPoint.y()); - line.setAngle(angle); + QLineF line; + line.setP1(originPoint); + line.setAngle(angle); // First set angle then length. Length can have negative value. + line.setLength(length); return line.p2(); }