Fix moving a point.

First set angle then length. Length can have negative value.
This commit is contained in:
Roman Telezhynskyi 2023-11-14 15:31:07 +02:00
parent 7f6231f480
commit c84d1153ab

View File

@ -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 auto VPointF::MovePF(const QPointF &originPoint, qreal length, qreal angle) -> QPointF
{ {
QLineF line(originPoint.x(), originPoint.y(), originPoint.x() + length, originPoint.y()); QLineF line;
line.setAngle(angle); line.setP1(originPoint);
line.setAngle(angle); // First set angle then length. Length can have negative value.
line.setLength(length);
return line.p2(); return line.p2();
} }