From d3f24308e6ba536d39d7ce889f21c27521cc5407 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 12 Jan 2022 13:47:37 -0800 Subject: [PATCH] Handle rotated symbol rectangles in Eagle import Fixes https://gitlab.com/kicad/code/kicad/issues/10360 (cherry picked from commit dcb8f29317a89dd336cdc6aaf3356ea6fa7eda56) --- eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp index 05ee1655dc..01257e7bde 100644 --- a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp +++ b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp @@ -1777,6 +1777,19 @@ LIB_SHAPE* SCH_EAGLE_PLUGIN::loadSymbolRectangle( std::unique_ptr& a rectangle->SetPosition( VECTOR2I( rect.x1.ToSchUnits(), rect.y1.ToSchUnits() ) ); rectangle->SetEnd( VECTOR2I( rect.x2.ToSchUnits(), rect.y2.ToSchUnits() ) ); + if( rect.rot ) + { + wxPoint pos( rectangle->GetPosition() ); + wxPoint end( rectangle->GetEnd() ); + wxPoint center( rectangle->GetCenter() ); + + RotatePoint( &pos, center, rect.rot->degrees * 10 ); + RotatePoint( &end, center, rect.rot->degrees * 10 ); + + rectangle->SetPosition( pos ); + rectangle->SetEnd( end ); + } + rectangle->SetUnit( aGateNumber ); // Eagle rectangles are filled by definition.