Do not call TransformToPoly for negative sized PADs

This commit is contained in:
david-beinder 2021-11-11 18:35:01 +01:00 committed by Wayne Stambaugh
parent 2515948a7b
commit fd6a75b779
2 changed files with 12 additions and 2 deletions

View File

@ -322,8 +322,13 @@ void BOARD_ADAPTER::createPadWithClearance( const PAD* aPad, CONTAINER_2D_BASE*
if( ( clearance.x < 0 || clearance.x != clearance.y )
&& aPad->GetShape() != PAD_SHAPE::CUSTOM )
{
wxSize dummySize = aPad->GetSize() + clearance + clearance;
if( dummySize.x <= 0 || dummySize.y <= 0 )
return;
PAD dummy( *aPad );
dummy.SetSize( aPad->GetSize() + clearance + clearance );
dummy.SetSize( dummySize );
dummy.TransformShapeWithClearanceToPolygon( poly, aLayer, 0, ARC_HIGH_DEF, ERROR_INSIDE );
clearance = { 0, 0 };
}

View File

@ -2266,8 +2266,13 @@ void FOOTPRINT::TransformPadsWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuff
if( ( clearance.x < 0 || clearance.x != clearance.y )
&& pad->GetShape() != PAD_SHAPE::CUSTOM )
{
wxSize dummySize = pad->GetSize() + clearance + clearance;
if( dummySize.x <= 0 || dummySize.y <= 0 )
continue;
PAD dummy( *pad );
dummy.SetSize( pad->GetSize() + clearance + clearance );
dummy.SetSize( dummySize );
dummy.TransformShapeWithClearanceToPolygon( aCornerBuffer, aLayer, 0,
aMaxError, aErrorLoc );
}