Browse Source

Increase bounding box of stroke text and the leader box of all text.

Fixes https://gitlab.com/kicad/code/kicad/issues/13009
7.0
Jeff Young 3 years ago
parent
commit
740e193871
  1. 4
      common/font/font.cpp
  2. 2
      pcbnew/pcb_dimension.cpp

4
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();

2
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();

Loading…
Cancel
Save