From 06e0e16336fb7935b2e5dc355742346948676d81 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Wed, 1 Jan 2025 16:34:30 -0500 Subject: [PATCH] API: Fix GetPadShapeAsPolygon to not re-use a SHAPE_POLY_SET TransformShapeToPolygon appends instead of assigning --- pcbnew/api/api_handler_pcb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcbnew/api/api_handler_pcb.cpp b/pcbnew/api/api_handler_pcb.cpp index f8179fb076..284e298a21 100644 --- a/pcbnew/api/api_handler_pcb.cpp +++ b/pcbnew/api/api_handler_pcb.cpp @@ -671,7 +671,6 @@ HANDLER_RESULT API_HANDLER_PCB::handleGetPadShapeAsPo if( !documentValidation ) return tl::unexpected( documentValidation.error() ); - SHAPE_POLY_SET poly; PadShapeAsPolygonResponse response; PCB_LAYER_ID layer = FromProtoEnum( aCtx.Request.layer() ); @@ -686,6 +685,7 @@ HANDLER_RESULT API_HANDLER_PCB::handleGetPadShapeAsPo response.add_pads()->set_value( padRequest.value() ); PAD* pad = static_cast( *optPad ); + SHAPE_POLY_SET poly; pad->TransformShapeToPolygon( poly, pad->Padstack().EffectiveLayerFor( layer ), 0, ARC_HIGH_DEF, ERROR_INSIDE );