Browse Source

PCB_TEXTBOX:: Rotate: fix size change for rotation by not 90deg

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20529
revert-0c36e162
jean-pierre charras 9 months ago
parent
commit
76929808d3
  1. 6
      pcbnew/pcb_textbox.cpp

6
pcbnew/pcb_textbox.cpp

@ -500,7 +500,13 @@ void PCB_TEXTBOX::Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle )
if( GetTextAngle().IsCardinal() && GetShape() != SHAPE_T::RECTANGLE )
{
// To convert the polygon to its equivalent rectangle, we use GetCornersInSequence()
// but this method uses the polygon bounding box.
// set the line thickness to 0 to get the actual rectangle corner
int lineWidth = GetWidth();
SetWidth( 0 );
std::vector<VECTOR2I> corners = GetCornersInSequence();
SetWidth( lineWidth );
VECTOR2I diag = corners[2] - corners[0];
EDA_ANGLE angle = GetTextAngle();

Loading…
Cancel
Save