From 952c1544221c39b128b5532b8464f5ff025e0aec Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 26 Feb 2024 22:27:11 +0000 Subject: [PATCH] Fix wrong rotation centre. Fixes https://gitlab.com/kicad/code/kicad/-/issues/17135 --- pcbnew/pcb_io/eagle/pcb_io_eagle.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp b/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp index 06b2f15cc2..f824a9fb91 100644 --- a/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp +++ b/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp @@ -922,7 +922,11 @@ void PCB_IO_EAGLE::loadPlain( wxXmlNode* aGraphics ) zone->AppendCorner( VECTOR2I( kicad_x( r.x1 ), kicad_y( r.y2 ) ), outlineIdx ); if( r.rot ) - zone->Rotate( zone->GetPosition(), EDA_ANGLE( r.rot->degrees, DEGREES_T ) ); + { + VECTOR2I center( ( kicad_x( r.x1 ) + kicad_x( r.x2 ) ) / 2, + ( kicad_y( r.y1 ) + kicad_y( r.y2 ) ) / 2 ); + zone->Rotate( center, EDA_ANGLE( r.rot->degrees, DEGREES_T ) ); + } // this is not my fault: zone->SetBorderDisplayStyle( outline_hatch, ZONE::GetDefaultHatchPitch(), true );