summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorJosh Bell <josh@lindenlab.com>2007-02-20 22:02:36 +0000
committerJosh Bell <josh@lindenlab.com>2007-02-20 22:02:36 +0000
commit7dada07dbaae3dfb9b1319453e51019bfff2717f (patch)
treea7f2b84ea65c39cee31474640dd5f265c0b2f432 /indra/llrender
parent73bc0fb42b5bcd80030d9f30d5cb57ec2397ba08 (diff)
svn merge -r 57620:58007 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llfontgl.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 7c0289b580..f42122b0ee 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -628,7 +628,7 @@ S32 LLFontGL::render(const LLWString &wstr,
case LEFT:
break;
case RIGHT:
- cur_x -= (F32)getWidth(wstr.c_str(), 0, length) * sScaleX;
+ cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), 0, length) * sScaleX));
break;
case HCENTER:
cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), 0, length) * sScaleX)) / 2;
@@ -653,12 +653,13 @@ S32 LLFontGL::render(const LLWString &wstr,
BOOL draw_ellipses = FALSE;
- if (use_ellipses)
+ if (use_ellipses && halign == LEFT)
{
// check for too long of a string
if (getWidthF32(wstr.c_str(), 0, max_chars) > scaled_max_pixels)
{
- const LLWString dots(utf8str_to_wstring(LLString("...")));
+ // use four dots for ellipsis width to generate padding
+ const LLWString dots(utf8str_to_wstring(LLString("....")));
scaled_max_pixels = llmax(0, scaled_max_pixels - llround(getWidthF32(dots.c_str())));
draw_ellipses = TRUE;
}