summaryrefslogtreecommitdiff
path: root/indra/llrender/llfontgl.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-01-18 16:31:05 -0800
committerRichard Linden <none@none>2012-01-18 16:31:05 -0800
commite4d4dbd6865a21b6e0027976b9b958cce8eed2c2 (patch)
treedb56bf2e8bb976cb38edae163203c951c0d1af8d /indra/llrender/llfontgl.cpp
parent916d61e4600df58329524e59c06d9621cab02393 (diff)
parent3a597af700e55e2017c85220b2b97cc9f3aef9aa (diff)
Automated merge with ssh://hg.lindenlab.com/richard/viewer-experience
Diffstat (limited to 'indra/llrender/llfontgl.cpp')
-rw-r--r--indra/llrender/llfontgl.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 82e8227ffe..12f86cf599 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -218,13 +218,13 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
switch (valign)
{
case TOP:
- cur_y -= mFontFreetype->getAscenderHeight();
+ cur_y -= getAscenderHeight();
break;
case BOTTOM:
- cur_y += mFontFreetype->getDescenderHeight();
+ cur_y += getDescenderHeight();
break;
case VCENTER:
- cur_y -= (mFontFreetype->getAscenderHeight() - mFontFreetype->getDescenderHeight()) / 2.f;
+ cur_y -= (getAscenderHeight() - getDescenderHeight()) / 2.f;
break;
case BASELINE:
// Baseline, do nothing.
@@ -390,12 +390,12 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
//FIXME: add underline as glyph?
if (style_to_add & UNDERLINE)
{
- F32 descender = mFontFreetype->getDescenderHeight();
+ F32 descender = (F32)llfloor(mFontFreetype->getDescenderHeight());
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.begin(LLRender::LINES);
- gGL.vertex2f(start_x, cur_y - (descender));
- gGL.vertex2f(cur_x, cur_y - (descender));
+ gGL.vertex2f(start_x, cur_y - descender);
+ gGL.vertex2f(cur_x, cur_y - descender);
gGL.end();
}
@@ -446,17 +446,17 @@ S32 LLFontGL::renderUTF8(const std::string &text, S32 begin_offset, S32 x, S32 y
// font metrics - override for LLFontFreetype that returns units of virtual pixels
F32 LLFontGL::getLineHeight() const
{
- return (F32)llround(mFontFreetype->getLineHeight() / sScaleY);
+ return (F32)llceil(mFontFreetype->getLineHeight() / sScaleY);
}
F32 LLFontGL::getAscenderHeight() const
{
- return (F32)llround(mFontFreetype->getAscenderHeight() / sScaleY);
+ return (F32)llceil(mFontFreetype->getAscenderHeight() / sScaleY);
}
F32 LLFontGL::getDescenderHeight() const
{
- return (F32)llround(mFontFreetype->getDescenderHeight() / sScaleY);
+ return (F32)llceil(mFontFreetype->getDescenderHeight() / sScaleY);
}
S32 LLFontGL::getWidth(const std::string& utf8text) const