From e05b3955a522b488945a2751c6885b2716d3108c Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 4 Dec 2023 12:46:39 +0100 Subject: [PATCH] Gerber export: fix incorrect shape of round rect pads on paste layers in some cases. They can be plotted as rect shape depending on margin value. From master branch. Fixes #16257 https://gitlab.com/kicad/code/kicad/-/issues/16257 --- pcbnew/plot_board_layers.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index 537511b17d..35156a99db 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -1,10 +1,3 @@ -/** - * @file plot_board_layers.cpp - * @brief Functions to plot one board layer (silkscreen layers or other layers). - * Silkscreen layers have specific requirement for pads (not filled) and texts - * (with option to remove them from some copper areas (pads...) - */ - /* * This program source code file is part of KiCad, a free EDA CAD application. * @@ -28,6 +21,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +/** + * @brief Functions to plot one board layer (silkscreen layers or other layers). + * Silkscreen layers have specific requirement for pads (not filled) and texts + * (with option to remove them from some copper areas (pads...) + */ + #include #include @@ -448,11 +447,12 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, case PAD_SHAPE::ROUNDRECT: { - // rounding is stored as a percent, but we have to change the new radius - // to initial_radius + clearance to have a inflated/deflated similar shape - int initial_radius = pad->GetRoundRectCornerRadius(); + // rounding is stored as a percent, but we have to update this ratio + // to force recalculation of other values after size changing (we do not + // really change the rounding percent value) + double radius_ratio = pad->GetRoundRectRadiusRatio(); pad->SetSize( padPlotsSize ); - pad->SetRoundRectCornerRadius( std::max( initial_radius + mask_clearance, 0 ) ); + pad->SetRoundRectRadiusRatio( radius_ratio ); itemplotter.PlotPad( pad, color, padPlotMode ); break;