summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-09-27 11:18:39 -0700
committerRichard Linden <none@none>2013-09-27 11:18:39 -0700
commite0a443f5a6b76fd1ab5ffaa8e7a1941d47c80f4f (patch)
treeba8ed1f921f6ddb8c16b37be082d48fd700211de /indra/llui
parent1733be96680e7ceb1911acc6af7fa3e12282fad7 (diff)
BUILDFIX: fix for mac builds
also, fixed alignment of tick labels on stat bars
Diffstat (limited to 'indra/llui')
-rwxr-xr-xindra/llui/llstatbar.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp
index 4ee10837b6..bc8235132e 100755
--- a/indra/llui/llstatbar.cpp
+++ b/indra/llui/llstatbar.cpp
@@ -708,14 +708,14 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect )
{
decimal_digits = 0;
}
- std::string tick_string = llformat("%10.*f", decimal_digits, tick_value);
-
+ std::string tick_label = llformat("%.*f", decimal_digits, tick_value);
+ S32 tick_label_width = LLFontGL::getFontMonospace()->getWidth(tick_label);
if (mOrientation == HORIZONTAL)
{
if (begin > last_label + MIN_LABEL_SPACING)
{
gl_rect_2d(bar_rect.mLeft, end, bar_rect.mRight - TICK_LENGTH, begin, LLColor4(1.f, 1.f, 1.f, 0.25f));
- LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, bar_rect.mRight, begin,
+ LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, bar_rect.mRight, begin,
LLColor4(1.f, 1.f, 1.f, 0.5f),
LLFontGL::LEFT, LLFontGL::VCENTER);
last_label = begin;
@@ -730,10 +730,11 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect )
if (begin > last_label + MIN_LABEL_SPACING)
{
gl_rect_2d(begin, bar_rect.mTop, end, bar_rect.mBottom - TICK_LENGTH, LLColor4(1.f, 1.f, 1.f, 0.25f));
- LLFontGL::getFontMonospace()->renderUTF8(tick_string, 0, begin - 1, bar_rect.mBottom - TICK_LENGTH,
+ S32 label_pos = begin - llround((F32)tick_label_width * ((F32)begin / (F32)bar_rect.getWidth()));
+ LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, label_pos, bar_rect.mBottom - TICK_LENGTH,
LLColor4(1.f, 1.f, 1.f, 0.5f),
- LLFontGL::RIGHT, LLFontGL::TOP);
- last_label = begin;
+ LLFontGL::LEFT, LLFontGL::TOP);
+ last_label = label_pos;
}
else
{