ConvertOutlineToPolygon(): fix handling of polygons living in footprints.

Due to recent changes in PCB_SHAPE items, the polygon coordinates are now
in board coordinates, not in coord relatives to the parent footprint.
Fixes #14530
https://gitlab.com/kicad/code/kicad/issues/14530
This commit is contained in:
jean-pierre charras 2023-04-13 17:21:51 +02:00
parent 33b2b5b09d
commit 97a4e535dc
1 changed files with 0 additions and 11 deletions

View File

@ -220,20 +220,9 @@ bool ConvertOutlineToPolygon( std::vector<PCB_SHAPE*>& aShapeList, SHAPE_POLY_SE
// with other shapes), so process them separately. // with other shapes), so process them separately.
if( graphic->GetShape() == SHAPE_T::POLY ) if( graphic->GetShape() == SHAPE_T::POLY )
{ {
EDA_ANGLE orientation = ANGLE_0;
VECTOR2I offset = VECTOR2I( 0, 0 );
if( graphic->GetParentFootprint() )
{
orientation = graphic->GetParentFootprint()->GetOrientation();
offset = graphic->GetParentFootprint()->GetPosition();
}
for( auto it = graphic->GetPolyShape().CIterate(); it; it++ ) for( auto it = graphic->GetPolyShape().CIterate(); it; it++ )
{ {
VECTOR2I pt = *it; VECTOR2I pt = *it;
RotatePoint( pt, orientation );
pt += offset;
currContour.Append( pt ); currContour.Append( pt );