From f0ef6932b80eeeabec9bfc35b1bc2a4b27a3ea4a Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 23 Jul 2022 13:52:24 +0100 Subject: [PATCH] Fix issues with plotting textbox outlines. Fixes https://gitlab.com/kicad/code/kicad/issues/11943 --- pcbnew/board.cpp | 5 +++++ pcbnew/pcb_textbox.cpp | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index 6856ac43fa..fa5cc9d0a5 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -2305,6 +2305,11 @@ void BOARD::ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, case PCB_TEXTBOX_T: { const PCB_TEXTBOX* textbox = static_cast( item ); + + // plot border + textbox->PCB_SHAPE::TransformShapeWithClearanceToPolygon( aOutlines, aLayer, 0, + maxError, ERROR_INSIDE ); + // plot text textbox->TransformTextShapeWithClearanceToPolygon( aOutlines, aLayer, 0, maxError, ERROR_INSIDE ); break; diff --git a/pcbnew/pcb_textbox.cpp b/pcbnew/pcb_textbox.cpp index ebf201f14c..60ffeba1df 100644 --- a/pcbnew/pcb_textbox.cpp +++ b/pcbnew/pcb_textbox.cpp @@ -436,8 +436,8 @@ std::shared_ptr PCB_TEXTBOX::GetEffectiveShape( PCB_LAYER_ID aLayer, FLAS void PCB_TEXTBOX::TransformTextShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, - PCB_LAYER_ID aLayer, int aClearance, - int aError, ERROR_LOC aErrorLoc ) const + PCB_LAYER_ID aLayer, int aClearance, + int aError, ERROR_LOC aErrorLoc ) const { KIGFX::GAL_DISPLAY_OPTIONS empty_opts; KIFONT::FONT* font = GetDrawFont(); @@ -459,7 +459,7 @@ void PCB_TEXTBOX::TransformTextShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCor aCornerBuffer.Append( point.x, point.y ); } ); - font->Draw( &callback_gal, GetShownText(), GetTextPos(), GetAttributes() ); + font->Draw( &callback_gal, GetShownText(), GetDrawPos(), GetAttributes() ); }