diff options
author | Richard Linden <none@none> | 2013-09-27 11:19:07 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2013-09-27 11:19:07 -0700 |
commit | 35b591a47d71212e3b2c1b7eaca797d6927bde42 (patch) | |
tree | a3b31affbed4f91af743a8584947d400a7d7f96d /indra/llui/llstatbar.cpp | |
parent | 2fad2cc7365803b63bfe2466da2558182a1c25b9 (diff) | |
parent | e0a443f5a6b76fd1ab5ffaa8e7a1941d47c80f4f (diff) |
Automated merge with http://bitbucket.org/lindenlab/viewer-interesting
Diffstat (limited to 'indra/llui/llstatbar.cpp')
-rwxr-xr-x | indra/llui/llstatbar.cpp | 13 |
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 { |