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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user