From 79d2765eb82f576f9599ce44c466966a0e2cb81d Mon Sep 17 00:00:00 2001 From: PontusPih Date: Tue, 20 Oct 2026 18:43:03 +0200 Subject: [PATCH] Fix the rotation of a selection moved with the free move tool UpdateFreeMoveTool combined the world rotation with the focus frame in the wrong order, so a selection turned around anything but the vertical axis ended up rotated wrongly, compounding with every mouse move. Train track connections only turn around the vertical axis, where the order doesn't matter. --- common/lc_model.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/lc_model.cpp b/common/lc_model.cpp index 0d31d11c..6bf9902b 100644 --- a/common/lc_model.cpp +++ b/common/lc_model.cpp @@ -5741,7 +5741,8 @@ void lcModel::UpdateFreeMoveTool(lcPiece* MousePiece, const lcMatrix44& StartTra lcMatrix33 RelativeRotation = MousePiece->GetRelativeRotation(); lcMatrix33 WorldToFocusMatrix = lcMatrix33AffineInverse(RelativeRotation); - RotationMatrix = lcMul(RotationMatrix, RelativeRotation); + // Rotate() expects the rotation in the focus frame. + RotationMatrix = lcMul(RelativeRotation, RotationMatrix); int Flags; std::vector Selection;