From d8498b62e0d44442b4e0038ed1fb765a796f0113 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 11 Nov 2023 16:43:48 +0100 Subject: [PATCH] PCB_TEXTBOX::TransformShapeToPolygon(): fix incorrect transform: when it is a polygon (rotated rect by a non cardinal angle) the polygon is not filled, so the shape is just a set of thick segments. Fixes #16072 https://gitlab.com/kicad/code/kicad/-/issues/16072 --- 3d-viewer/3d_canvas/create_layer_items.cpp | 2 ++ pcbnew/pcb_textbox.cpp | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/3d-viewer/3d_canvas/create_layer_items.cpp b/3d-viewer/3d_canvas/create_layer_items.cpp index 4e0cfcb4f6..8aa5408fca 100644 --- a/3d-viewer/3d_canvas/create_layer_items.cpp +++ b/3d-viewer/3d_canvas/create_layer_items.cpp @@ -620,6 +620,8 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) case PCB_TEXTBOX_T: addText( static_cast( item ), layerContainer, item ); + + if( static_cast( item )->IsBorderEnabled() ) addShape( static_cast( item ), layerContainer, item ); break; diff --git a/pcbnew/pcb_textbox.cpp b/pcbnew/pcb_textbox.cpp index 68d7661639..fcf6972690 100644 --- a/pcbnew/pcb_textbox.cpp +++ b/pcbnew/pcb_textbox.cpp @@ -580,9 +580,8 @@ void PCB_TEXTBOX::TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID const SHAPE_LINE_CHAIN& poly = m_poly.Outline( 0 ); - for( int ii = 0; ii < poly.PointCount(); ++ii ) - aBuffer.Append( poly.GetPoint( ii ) ); - + // build the polygon outline as a list of segmemts + // (The polygon is not filled). if( m_borderEnabled && width > 0 ) { for( int ii = 0; ii < poly.SegmentCount(); ++ii )