mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-07 17:15:31 +00:00
Use render cache (when available) for 3D viewer.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18672
This commit is contained in:
parent
01fb6c80ed
commit
eccc5bca3e
@ -100,6 +100,7 @@ void BOARD_ADAPTER::addText( const EDA_TEXT* aText, CONTAINER_2D_BASE* aContaine
|
||||
TEXT_ATTRIBUTES attrs = aText->GetAttributes();
|
||||
float penWidth_3DU = TO_3DU( aText->GetEffectiveTextPenWidth() );
|
||||
KIFONT::FONT* font = aText->GetFont();
|
||||
wxString shownText = aText->GetShownText( true );
|
||||
|
||||
if( !font )
|
||||
font = KIFONT::FONT::GetFont( wxEmptyString, aText->IsBold(), aText->IsItalic() );
|
||||
@ -134,8 +135,15 @@ void BOARD_ADAPTER::addText( const EDA_TEXT* aText, CONTAINER_2D_BASE* aContaine
|
||||
|
||||
attrs.m_Angle = aText->GetDrawRotation();
|
||||
|
||||
font->Draw( &callback_gal, aText->GetShownText( true ), aText->GetDrawPos(), attrs,
|
||||
aOwner->GetFontMetrics() );
|
||||
if( auto* cache = aText->GetRenderCache( font, shownText ) )
|
||||
{
|
||||
callback_gal.DrawGlyphs( *cache );
|
||||
}
|
||||
else
|
||||
{
|
||||
font->Draw( &callback_gal, shownText, aText->GetDrawPos(), attrs,
|
||||
aOwner->GetFontMetrics() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user