From c32ebc59365c9380e198fa1aefbc27783ff16933 Mon Sep 17 00:00:00 2001 From: plc-user <74435298+plc-user@users.noreply.github.com> Date: Mon, 19 Oct 2026 19:12:19 +0200 Subject: [PATCH] PartArc, normalize: after review 360 becomes 0 degree --- sources/editor/graphicspart/partarc.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/editor/graphicspart/partarc.cpp b/sources/editor/graphicspart/partarc.cpp index f4070c9a9..4b3913234 100644 --- a/sources/editor/graphicspart/partarc.cpp +++ b/sources/editor/graphicspart/partarc.cpp @@ -94,12 +94,12 @@ void PartArc::normalizeAngles(qreal &start, qreal &angle) { constexpr qreal CIRCLE = 360.0 * 16.0; // internal representation of angles in 1/16 degree - while (start < 0.0) { start += CIRCLE; } // always positive start - while (start > CIRCLE) { start -= CIRCLE; } // within 0 ... 360 + while (start < 0.0) { start += CIRCLE; } // always positive start + while (start >= CIRCLE) { start -= CIRCLE; } // within 0 ... 360 if (angle < 0.0) { start = (start + angle + CIRCLE); - while (start < 0.0) { start += CIRCLE; } - while (start > CIRCLE) { start -= CIRCLE; } + while (start < 0.0) { start += CIRCLE; } + while (start >= CIRCLE) { start -= CIRCLE; } angle *= (-1.0); } }