From 91f40ac7794d6dd224fee41597fdf38df6e55ad1 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 14 May 2023 15:37:45 +0300 Subject: [PATCH] Make sure text bounding box exists when syncing PNS world. Based on d790865549ee9fa7b3534fd9268503cbf69bac68 Fixes https://gitlab.com/kicad/code/kicad/issues/14733 --- pcbnew/router/pns_kicad_iface.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index 3cd04abed6..07bfd8cd49 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -1266,7 +1266,11 @@ bool PNS_KICAD_IFACE_BASE::syncTextItem( PNS::NODE* aWorld, EDA_TEXT* aText, PCB int margin = attrs.m_StrokeWidth * 1.5 + GetKnockoutTextMargin( attrs.m_Size, attrs.m_StrokeWidth ); pcb_text->TransformBoundingBoxToPolygon( &buffer, margin ); + // buffer should contain a single rectangular polygon + if( !buffer.OutlineCount() ) + return false; + SHAPE_SIMPLE* rectShape = new SHAPE_SIMPLE; for( int ii = 0; ii < buffer.Outline(0).PointCount(); ii++ )