mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-01-20 14:54:46 +01:00
Fixed vertical alignment for certain strings that are too long to fit the image width.
This commit is contained in:
parent
2a39065a0b
commit
bdb105043e
@ -79,7 +79,6 @@ void Text::draw()
|
|||||||
float scale = (float)baseViewInfo.FontSize / (float)imageHeight;
|
float scale = (float)baseViewInfo.FontSize / (float)imageHeight;
|
||||||
|
|
||||||
unsigned int textIndexMax = 0;
|
unsigned int textIndexMax = 0;
|
||||||
unsigned int emptySpace = 0;
|
|
||||||
|
|
||||||
// determine image width
|
// determine image width
|
||||||
for(unsigned int i = 0; i < textData_.size(); ++i)
|
for(unsigned int i = 0; i < textData_.size(); ++i)
|
||||||
@ -94,12 +93,10 @@ void Text::draw()
|
|||||||
|
|
||||||
if ((imageWidth + glyph.advance)*scale > imageMaxWidth )
|
if ((imageWidth + glyph.advance)*scale > imageMaxWidth )
|
||||||
{
|
{
|
||||||
imageWidth -= emptySpace;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
textIndexMax = i;
|
textIndexMax = i;
|
||||||
emptySpace = glyph.advance - glyph.maxX;
|
|
||||||
imageWidth += glyph.advance;
|
imageWidth += glyph.advance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user