Avoid negative pad sizes in plot

Clearance can be negative but setting the pad size to negative leads to
invalid output in plotting

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18996
This commit is contained in:
Seth Hillbrand 2024-10-29 15:31:21 -07:00
parent 7074c31374
commit 3f36d7f1dd

View File

@ -563,7 +563,8 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
// anchor will be added to the pad shape when plotting the pad. So now the
// polygonal shape is built, we can clamp the anchor size
if( mask_clearance < 0 ) // we expect margin.x = margin.y for custom pads
dummy.SetSize( aLayer, padPlotsSize );
dummy.SetSize( aLayer, VECTOR2I( std::max( 0, padPlotsSize.x ),
std::max( 0, padPlotsSize.y ) ) );
itemplotter.PlotPad( &dummy, aLayer, color, padPlotMode );
break;