1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

IGUIFont / CGUITTFont code cleanups (#15581)

This commit is contained in:
sfan5 2024-12-23 12:49:47 +01:00 committed by GitHub
parent 0bfd9bc09e
commit c49ff76955
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 135 additions and 626 deletions

View file

@ -74,7 +74,7 @@ void StaticText::draw()
updateText();
core::rect<s32> r = frameRect;
s32 height_line = font->getDimension(L"A").Height + font->getKerningHeight();
s32 height_line = font->getDimension(L"A").Height + font->getKerning(L'A').Y;
s32 height_total = height_line * BrokenText.size();
if (VAlign == EGUIA_CENTER && WordWrap)
{
@ -546,7 +546,7 @@ s32 StaticText::getTextHeight() const
return 0;
if (WordWrap) {
s32 height = font->getDimension(L"A").Height + font->getKerningHeight();
s32 height = font->getDimension(L"A").Height + font->getKerning(L'A').Y;
return height * BrokenText.size();
}
// There may be intentional new lines without WordWrap