Replace larger text bboxes now that we're not using them for knockouts.

(cherry picked from commit 570978fa7f)
This commit is contained in:
Jeff Young 2023-05-28 18:17:24 +01:00
parent 214f785c97
commit 9eaa5f90e0
2 changed files with 4 additions and 5 deletions

View File

@ -563,13 +563,10 @@ BOX2I EDA_TEXT::GetTextBox( int aLine, bool aInvertY ) const
// bounding box will be moved later according to the actual text options
wxSize textsize = wxSize( extents.x, extents.y );
VECTOR2I pos = drawPos;
int fudgeFactor = extents.y * 0.17;
if( font->IsStroke() )
{
int fudgeFactor = extents.y * 0.17;
textsize.y += fudgeFactor;
pos.y += fudgeFactor / 2;
}
if( IsMultilineAllowed() && aLine > 0 && aLine < (int) strings.GetCount() )
pos.y -= KiROUND( aLine * font->GetInterline( fontSize.y ) );
@ -627,6 +624,7 @@ BOX2I EDA_TEXT::GetTextBox( int aLine, bool aInvertY ) const
switch( GetVertJustify() )
{
case GR_TEXT_V_ALIGN_TOP:
bbox.Offset( 0, -fudgeFactor );
break;
case GR_TEXT_V_ALIGN_CENTER:
@ -635,6 +633,7 @@ BOX2I EDA_TEXT::GetTextBox( int aLine, bool aInvertY ) const
case GR_TEXT_V_ALIGN_BOTTOM:
bbox.SetY( bbox.GetY() - bbox.GetHeight() );
bbox.Offset( 0, fudgeFactor );
break;
}

View File

@ -347,7 +347,7 @@ 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 * 1.25 ) );
boundingBox.Inflate( KiROUND( aThickness * 1.5 ) );
}
else if( IsOutline() )
{