Rename BuildPolyPointsList() to DupPolyPointsList() and optimize code
to avoid multiple useless copies of the list of polygon corners in code.
This commit is contained in:
@@ -627,25 +627,20 @@ void BRDITEMS_PLOTTER::PlotFootprintGraphicItem( const FP_SHAPE* aShape )
|
||||
case SHAPE_T::POLY:
|
||||
if( aShape->IsPolyShapeValid() )
|
||||
{
|
||||
const std::vector<wxPoint> &polyPoints = aShape->BuildPolyPointsList();
|
||||
std::vector<wxPoint> cornerList;
|
||||
aShape->DupPolyPointsList( cornerList );
|
||||
|
||||
// We must compute board coordinates from m_PolyList which are relative to the parent
|
||||
// position at orientation 0
|
||||
const FOOTPRINT *parentFootprint = aShape->GetParentFootprint();
|
||||
|
||||
std::vector<wxPoint> cornerList;
|
||||
|
||||
cornerList.reserve( polyPoints.size() );
|
||||
|
||||
for( wxPoint corner : polyPoints )
|
||||
if( parentFootprint )
|
||||
{
|
||||
if( parentFootprint )
|
||||
for( wxPoint corner : cornerList )
|
||||
{
|
||||
RotatePoint( &corner, parentFootprint->GetOrientation() );
|
||||
corner += parentFootprint->GetPosition();
|
||||
}
|
||||
|
||||
cornerList.push_back( corner );
|
||||
}
|
||||
|
||||
if( sketch || thickness > 0 )
|
||||
|
||||
Reference in New Issue
Block a user