From 111a8e5fddf03239985115c0304c9476a5ad58ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C4=81rlis=20Se=C5=86ko?= Date: Thu, 6 Nov 2025 12:05:06 +0200 Subject: [PATCH] Arrange circular followup cleanup Followup for 66533c4019e93e370b713ca821d5e13cb27bc04b * Make the parametrized angle label match the individual tooltips and current behavior of 2 angles * Treat -360 deg as full circle symmetric to 360 deg * Simplify special case handling for count, no breaks or continue in loop so count should match --- src/ui/dialog/polar-arrange-tab.cpp | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/ui/dialog/polar-arrange-tab.cpp b/src/ui/dialog/polar-arrange-tab.cpp index 8faabfd7f1..1b69a81a8e 100644 --- a/src/ui/dialog/polar-arrange-tab.cpp +++ b/src/ui/dialog/polar-arrange-tab.cpp @@ -104,7 +104,7 @@ PolarArrangeTab::PolarArrangeTab(ArrangeDialog *parent_) parametersTable.attach(radiusX, 1, 1, 1, 1); parametersTable.attach(radiusY, 2, 1, 1, 1); - angleLabel.set_text(_("Angle X/Y:")); + angleLabel.set_text(_("Angle start/end:")); parametersTable.attach(angleLabel, 0, 2, 1, 1); angleX.setDigits(2); angleX.setIncrements(0.2, 0); @@ -272,7 +272,13 @@ void PolarArrangeTab::arrange() bool arrangeOnFirstEllipse = arrangeOnEllipse && arrangeOnFirstCircleRadio.get_active(); float yaxisdir = parent->getDesktop()->yaxisdir(); - int count = 0; + int count = tmp.size(); + float cx, cy; // Center of the ellipse + float rx, ry; // Radiuses of the ellipse in x and y direction + float arcBeg; + float arcLength; + bool whole = false; + Geom::Affine transformation; // Any additional transformation to apply to the objects if (arrangeOnEllipse) { for (auto item : tmp) { if (auto ellipse = cast(item)) { @@ -280,19 +286,8 @@ void PolarArrangeTab::arrange() referenceEllipse = ellipse; } } - ++count; } - } else { - count = tmp.size(); - } - float cx, cy; // Center of the ellipse - float rx, ry; // Radiuses of the ellipse in x and y direction - float arcBeg; - float arcLength; - bool whole = false; - Geom::Affine transformation; // Any additional transformation to apply to the objects - if (arrangeOnEllipse) { if (!referenceEllipse) { if (auto desktop = parent->getDesktop()) { desktop->showNotice(_("Couldn't find an ellipse in selection"), 5000); @@ -329,7 +324,7 @@ void PolarArrangeTab::arrange() arcBeg = angleX.getValue("rad"); float arcEnd = angleY.getValue("rad"); arcLength = arcEnd - arcBeg; - if (std::abs(arcLength - M_PI * 2) < 0.00001) { + if (std::abs(std::abs(arcLength) - M_PI * 2) < 0.00001) { whole = true; } transformation.setIdentity(); -- GitLab