From 1d30d079b0a4d7cc8e93cf1e458d7daf7fd0ccc5 Mon Sep 17 00:00:00 2001 From: PaddleStroke Date: Mon, 24 Nov 2025 05:40:04 +0100 Subject: [PATCH] Sketcher: Rotate: Fix line length ignored (#25434) --- src/Mod/Sketcher/Gui/DrawSketchHandlerRotate.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerRotate.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerRotate.h index 9c7788a159..83f7fc6d26 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerRotate.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerRotate.h @@ -373,19 +373,22 @@ private: } else if ((cstr->Type == Distance || cstr->Type == DistanceX || cstr->Type == DistanceY) - && firstIndex >= 0 && secondIndex >= 0) { + && firstIndex >= 0) { if (!deleteOriginal && cloneConstraints - && cstr->First == cstr->Second) { // only line distances - if (indexOfGeoId(geoIdsWhoAlreadyHasEqual, secondIndexi) != -1) { + && (cstr->First == cstr->Second || secondIndex < 0)) { // only line + // distances + if (indexOfGeoId(geoIdsWhoAlreadyHasEqual, firstIndexi) != -1) { continue; } newConstr->Type = Equal; newConstr->First = cstr->First; - newConstr->Second = secondIndexi; - geoIdsWhoAlreadyHasEqual.push_back(secondIndexi); + newConstr->Second = firstIndexi; + geoIdsWhoAlreadyHasEqual.push_back(firstIndexi); } else if (cstr->Type == Distance) { - newConstr->Second = secondIndexi; + if (secondIndex >= 0) { + newConstr->Second = secondIndexi; + } } else { // We should be able to handle cases where rotation is 90 or 180, but