From 740e193871eb2f537a3bfddd45182d2eaf008e2b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 27 Nov 2022 15:26:41 +0000 Subject: [PATCH] Increase bounding box of stroke text and the leader box of all text. Fixes https://gitlab.com/kicad/code/kicad/issues/13009 --- common/font/font.cpp | 4 ++-- pcbnew/pcb_dimension.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/font/font.cpp b/common/font/font.cpp index cad75aafa1..66d2199bf5 100644 --- a/common/font/font.cpp +++ b/common/font/font.cpp @@ -287,11 +287,11 @@ VECTOR2I FONT::StringBoundaryLimits( const wxString& aText, const VECTOR2I& aSiz if( IsStroke() ) { // Inflate by a bit more than thickness/2 to catch diacriticals, descenders, etc. - boundingBox.Inflate( KiROUND( aThickness * 0.75 ) ); + boundingBox.Inflate( KiROUND( aThickness * 1.5 ) ); } else if( IsOutline() ) { - // Outline fonts have thickness built in + // Outline fonts have thickness built in, and *usually* stay within their ascent/descent } return boundingBox.GetSize(); diff --git a/pcbnew/pcb_dimension.cpp b/pcbnew/pcb_dimension.cpp index cfba2f4e95..6f77edd281 100644 --- a/pcbnew/pcb_dimension.cpp +++ b/pcbnew/pcb_dimension.cpp @@ -997,7 +997,7 @@ void PCB_DIM_LEADER::updateGeometry() // Now that we have the text updated, we can determine how to draw the second line // First we need to create an appropriate bounding polygon to collide with BOX2I textBox = m_text.GetTextBox().Inflate( m_text.GetTextWidth() / 2, - m_text.GetEffectiveTextPenWidth() ); + m_text.GetEffectiveTextPenWidth() * 1.8 ); SHAPE_POLY_SET polyBox; polyBox.NewOutline();