1
0
forked from mirrors/0ad

Fix GUI text clipping when scaling interface

When scaling the GUI, GetCapHeight was incorrectly accounting for
m_Scale which caused text to be hidden due to improper clipping
calculations.
This commit corrects the CapHeight calculation by ensuring that the
division by m_Scale is applied, allowing text to be displayed correctly
at all GUI scale levels.
This commit is contained in:
trompetin17
2025-07-28 19:12:12 -05:00
parent 5d8debe676
commit b5e2ca7300
+1 -1
View File
@@ -95,7 +95,7 @@ float CFont::GetHeight() const {
float CFont::GetCapHeight()
{
const CFont::GlyphData* g{GetGlyph(L'I')};
return (g ? g->yadvance : 0) + std::abs(FPosF26Dot6ToFloat(m_Faces.front()->size->metrics.descender));
return (g ? g->yadvance : 0) + std::abs(FPosF26Dot6ToFloat(m_Faces.front()->size->metrics.descender)) / m_Scale;
}
float CFont::GetCharacterWidth(wchar_t c)