diff --git a/pcbnew/pad_custom_shape_functions.cpp b/pcbnew/pad_custom_shape_functions.cpp index fe46c0b1b1..34c70f8465 100644 --- a/pcbnew/pad_custom_shape_functions.cpp +++ b/pcbnew/pad_custom_shape_functions.cpp @@ -217,7 +217,6 @@ bool D_PAD::buildCustomPadPolygon( SHAPE_POLY_SET* aMergedPolygon, case S_POLYGON: // polygon if( bshape.m_Poly.size() < 2 ) break; // Malformed polygon. - { // Insert the polygon: const std::vector< wxPoint>& poly = bshape.m_Poly; @@ -237,7 +236,6 @@ bool D_PAD::buildCustomPadPolygon( SHAPE_POLY_SET* aMergedPolygon, aux_polyset.Append( polyset ); } - else for( unsigned ii = 0; ii < poly.size(); ii++ ) aux_polyset.Append( poly[ii].x, poly[ii].y ); diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index 96890ef980..9cc071c340 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -451,13 +451,6 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, // inflate/deflate a custom shape is a bit complex. // so build a similar pad shape, and inflate/deflate the polygonal shape { - // we expect margin.x = margin.y for custom pads - if( margin.x < 0 ) - // be sure the anchor pad is not bigger than the deflated shape - // because this anchor will be added to the pad shape when plotting - // the pad - pad->SetSize( padPlotsSize ); - D_PAD dummy( *pad ); SHAPE_POLY_SET shape; pad->MergePrimitivesAsPolygon( &shape, 64 ); @@ -470,6 +463,12 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, dummy.AddPrimitive( shape, 0 ); dummy.MergePrimitivesAsPolygon(); + // Be sure the anchor pad is not bigger than the deflated shape + // because this 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( margin.x < 0 ) // we expect margin.x = margin.y for custom pads + dummy.SetSize( padPlotsSize ); + itemplotter.PlotPad( &dummy, color, plotMode ); } break;