From 3e58425671e8f06ee82d944fb51e009785a466c9 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 10 Nov 2023 22:29:49 +0000 Subject: [PATCH] Flip rotation angle when board view is flipped. Fixes https://gitlab.com/kicad/code/kicad/-/issues/15954 --- pcbnew/tools/edit_tool.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index ee1bd2f2aa..bb5de1b008 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -1734,6 +1735,9 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) VECTOR2I refPt = selection.GetReferencePoint(); EDA_ANGLE rotateAngle = TOOL_EVT_UTILS::GetEventRotationAngle( *editFrame, aEvent ); + if( frame()->GetCanvas()->GetView()->GetGAL()->IsFlippedX() ) + rotateAngle = -rotateAngle; + // Calculate view bounding box BOX2I viewBBox = selection.Front()->ViewBBox();