mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-17 22:55:38 +00:00
Fix buildTextCache not taking line spacing into account for metrics.
Fix TextComponent's calculateExtent not taking line spacing into account.
This commit is contained in:
parent
ed1612a341
commit
b57c6b412c
|
@ -122,11 +122,11 @@ void TextComponent::calculateExtent()
|
||||||
{
|
{
|
||||||
if(mAutoCalcExtent.x())
|
if(mAutoCalcExtent.x())
|
||||||
{
|
{
|
||||||
mSize = mFont->sizeText(mUppercase ? strToUpper(mText) : mText);
|
mSize = mFont->sizeText(mUppercase ? strToUpper(mText) : mText, mLineSpacing);
|
||||||
}else{
|
}else{
|
||||||
if(mAutoCalcExtent.y())
|
if(mAutoCalcExtent.y())
|
||||||
{
|
{
|
||||||
mSize[1] = mFont->sizeWrappedText(mUppercase ? strToUpper(mText) : mText, getSize().x()).y();
|
mSize[1] = mFont->sizeWrappedText(mUppercase ? strToUpper(mText) : mText, getSize().x(), mLineSpacing).y();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -479,7 +479,7 @@ TextCache* Font::buildTextCache(const std::string& text, Eigen::Vector2f offset,
|
||||||
x += mCharData[letter].advX * mFontScale;
|
x += mCharData[letter].advX * mFontScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextCache::CacheMetrics metrics = { sizeText(text) };
|
TextCache::CacheMetrics metrics = { sizeText(text, lineSpacing) };
|
||||||
TextCache* cache = new TextCache(vertCount, vert, colors, metrics);
|
TextCache* cache = new TextCache(vertCount, vert, colors, metrics);
|
||||||
if(color != 0x00000000)
|
if(color != 0x00000000)
|
||||||
cache->setColor(color);
|
cache->setColor(color);
|
||||||
|
|
Loading…
Reference in a new issue