Flip rotation angle when board view is flipped.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15954
This commit is contained in:
Jeff Young 2023-11-10 22:29:49 +00:00
parent 9ef05fb762
commit 3e58425671
1 changed files with 4 additions and 0 deletions

View File

@ -27,6 +27,7 @@
#include <advanced_config.h> #include <advanced_config.h>
#include <limits> #include <limits>
#include <kiplatform/ui.h> #include <kiplatform/ui.h>
#include <gal/graphics_abstraction_layer.h>
#include <board.h> #include <board.h>
#include <board_design_settings.h> #include <board_design_settings.h>
#include <footprint.h> #include <footprint.h>
@ -1734,6 +1735,9 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
VECTOR2I refPt = selection.GetReferencePoint(); VECTOR2I refPt = selection.GetReferencePoint();
EDA_ANGLE rotateAngle = TOOL_EVT_UTILS::GetEventRotationAngle( *editFrame, aEvent ); EDA_ANGLE rotateAngle = TOOL_EVT_UTILS::GetEventRotationAngle( *editFrame, aEvent );
if( frame()->GetCanvas()->GetView()->GetGAL()->IsFlippedX() )
rotateAngle = -rotateAngle;
// Calculate view bounding box // Calculate view bounding box
BOX2I viewBBox = selection.Front()->ViewBBox(); BOX2I viewBBox = selection.Front()->ViewBBox();