Commit b57c6b41 authored by Aloshi's avatar Aloshi

Fix buildTextCache not taking line spacing into account for metrics.

Fix TextComponent's calculateExtent not taking line spacing into account.
parent ed1612a3
......@@ -122,11 +122,11 @@ void TextComponent::calculateExtent()
{
if(mAutoCalcExtent.x())
{
mSize = mFont->sizeText(mUppercase ? strToUpper(mText) : mText);
mSize = mFont->sizeText(mUppercase ? strToUpper(mText) : mText, mLineSpacing);
}else{
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;
}
TextCache::CacheMetrics metrics = { sizeText(text) };
TextCache::CacheMetrics metrics = { sizeText(text, lineSpacing) };
TextCache* cache = new TextCache(vertCount, vert, colors, metrics);
if(color != 0x00000000)
cache->setColor(color);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment