From 36275bcbc5882459a7553e9da870933dfdde20e3 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 3 Feb 2024 19:45:54 +0000 Subject: [PATCH] Make sure polygonization error is on correct side. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16869 --- common/eda_shape.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/eda_shape.cpp b/common/eda_shape.cpp index 5634d4f0ae..e84389d797 100644 --- a/common/eda_shape.cpp +++ b/common/eda_shape.cpp @@ -1737,7 +1737,14 @@ void EDA_SHAPE::TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, int aClearance tmp.Append( poly.GetPoint( jj ) ); if( width > 0 ) - tmp.Inflate( width/2, CORNER_STRATEGY::ROUND_ALL_CORNERS, aError, false); + { + int inflate = width / 2; + + if( aErrorLoc == ERROR_OUTSIDE ) + inflate += aError; + + tmp.Inflate( inflate, CORNER_STRATEGY::ROUND_ALL_CORNERS, aError ); + } aBuffer.Append( tmp ); }