mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-20 13:24:24 +02:00
PartArc, normalize: after review 360 becomes 0 degree
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user