From 37afcd93e28d5c9952ee0b9241024221f7c0c8f7 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 17 Jun 2019 05:28:52 -0700 Subject: [PATCH] pcbnew: Fix missing correction to Pad->Polygon transform The rounded radius needs to be corrected even when there is no clearance to ensure that the pad segments fall on the arc. --- pcbnew/board_items_to_polygon_shape_transform.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pcbnew/board_items_to_polygon_shape_transform.cpp b/pcbnew/board_items_to_polygon_shape_transform.cpp index fa49292c29..432da10327 100644 --- a/pcbnew/board_items_to_polygon_shape_transform.cpp +++ b/pcbnew/board_items_to_polygon_shape_transform.cpp @@ -638,18 +638,18 @@ void D_PAD::TransformShapeWithClearanceToPolygon( case PAD_SHAPE_CHAMFERED_RECT: case PAD_SHAPE_ROUNDRECT: { - SHAPE_POLY_SET outline; - int radius = GetRoundRectCornerRadius() + aClearanceValue; - int numSegs = std::max( GetArcToSegmentCount( radius, aError, 360.0 ), 6 ); - double correction = GetCircletoPolyCorrectionFactor( numSegs ); - int clearance = KiROUND( aClearanceValue * correction ); - int rounding_radius = GetRoundRectCornerRadius() + clearance; - wxSize shapesize( m_Size ); + int radius = GetRoundRectCornerRadius() + aClearanceValue; + int numSegs = std::max( GetArcToSegmentCount( radius, aError, 360.0 ), 6 ); + double correction = GetCircletoPolyCorrectionFactor( numSegs ); + int clearance = KiROUND( aClearanceValue * correction ); + int rounding_radius = KiROUND( radius * correction ); + wxSize shapesize( m_Size ); shapesize.x += clearance * 2; shapesize.y += clearance * 2; bool doChamfer = GetShape() == PAD_SHAPE_CHAMFERED_RECT; + SHAPE_POLY_SET outline; TransformRoundChamferedRectToPolygon( outline, padShapePos, shapesize, angle, rounding_radius, doChamfer ? GetChamferRectRatio() : 0.0, doChamfer ? GetChamferPositions() : 0, aError );