mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2025-12-30 02:28:51 +01:00
Fixed vertical alignment for text wider than the maximum width.
This commit is contained in:
parent
bead1312f8
commit
bf24f6cba2
@ -66,6 +66,9 @@ void Text::draw()
|
||||
float imageHeight = 0;
|
||||
float imageWidth = 0;
|
||||
|
||||
imageHeight = (float)font->getHeight();
|
||||
float scale = (float)baseViewInfo.FontSize / (float)imageHeight;
|
||||
|
||||
// determine image width
|
||||
for(unsigned int i = 0; i < textData_.size(); ++i)
|
||||
{
|
||||
@ -77,14 +80,14 @@ void Text::draw()
|
||||
imageWidth += glyph.minX;
|
||||
}
|
||||
|
||||
if ((imageWidth + glyph.advance)*scale > baseViewInfo.MaxWidth )
|
||||
break;
|
||||
|
||||
imageWidth += glyph.advance;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
imageHeight = (float)font->getHeight();
|
||||
float scale = (float)baseViewInfo.FontSize / (float)imageHeight;
|
||||
|
||||
float oldWidth = baseViewInfo.Width;
|
||||
float oldHeight = baseViewInfo.Height;
|
||||
float oldImageWidth = baseViewInfo.ImageHeight;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user