diff options
author | nat-goodspeed <nat@lindenlab.com> | 2024-09-05 15:40:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-05 15:40:12 -0400 |
commit | 04568da18d2261f3f7b851cf5341b766c9648204 (patch) | |
tree | 83d5db1c173636bb77ebb33e860fac77ab5d79e8 /indra/llui/llbadge.cpp | |
parent | 18d81e20f0b0044c16615953d7b69d7fb34d3449 (diff) | |
parent | ff2d79906ccef217194d5d9ec9d7025db03592a8 (diff) |
Merge pull request #2513 from secondlife/lua-merge-dev
Merge develop branch into Lua project branch.
Diffstat (limited to 'indra/llui/llbadge.cpp')
-rw-r--r-- | indra/llui/llbadge.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp index 3397c97ee1..c6654ee0aa 100644 --- a/indra/llui/llbadge.cpp +++ b/indra/llui/llbadge.cpp @@ -27,6 +27,8 @@ #define LLBADGE_CPP #include "llbadge.h" +#include "llfontgl.h" +#include "llfontvertexbuffer.h" #include "llscrollcontainer.h" #include "lluictrlfactory.h" @@ -36,7 +38,7 @@ static LLDefaultChildRegistry::Register<LLBadge> r("badge"); static const S32 BADGE_OFFSET_NOT_SPECIFIED = 0x7FFFFFFF; // Compiler optimization, generate extern template -template class LLBadge* LLView::getChild<class LLBadge>(const std::string& name, bool recurse) const; +template class LLBadge* LLView::getChild<class LLBadge>(std::string_view name, bool recurse) const; LLBadge::Params::Params() @@ -197,10 +199,10 @@ void renderBadgeBackground(F32 centerX, F32 centerY, F32 width, F32 height, cons F32 x = LLFontGL::sCurOrigin.mX + centerX - width * 0.5f; F32 y = LLFontGL::sCurOrigin.mY + centerY - height * 0.5f; - LLRectf screen_rect(ll_round(x), - ll_round(y), - ll_round(x) + width, - ll_round(y) + height); + LLRectf screen_rect((F32)ll_round(x), + (F32)ll_round(y), + (F32)ll_round(x) + width, + (F32)ll_round(y) + height); LLVector3 vertices[4]; vertices[0] = LLVector3(screen_rect.mRight, screen_rect.mTop, 1.0f); @@ -231,8 +233,6 @@ void LLBadge::draw() // Calculate badge size based on label text // - LLWString badge_label_wstring = mLabel; - S32 badge_label_begin_offset = 0; S32 badge_char_length = S32_MAX; S32 badge_pixel_length = S32_MAX; @@ -240,7 +240,7 @@ void LLBadge::draw() bool do_not_use_ellipses = false; F32 badge_width = (2.0f * mPaddingHoriz) + - mGLFont->getWidthF32(badge_label_wstring.c_str(), badge_label_begin_offset, badge_char_length); + mGLFont->getWidthF32(mLabel.getWString().c_str(), badge_label_begin_offset, badge_char_length); F32 badge_height = (2.0f * mPaddingVert) + mGLFont->getLineHeight(); @@ -302,7 +302,7 @@ void LLBadge::draw() } else { - badge_center_x = location_offset_horiz; + badge_center_x = (F32)location_offset_horiz; } // Compute y position @@ -319,7 +319,7 @@ void LLBadge::draw() } else { - badge_center_y = location_offset_vert; + badge_center_y = (F32)location_offset_vert; } // @@ -353,17 +353,17 @@ void LLBadge::draw() // // Draw the label // - - mGLFont->render(badge_label_wstring, - badge_label_begin_offset, - badge_center_x + mLabelOffsetHoriz, - badge_center_y + mLabelOffsetVert, - mLabelColor % alpha, - LLFontGL::HCENTER, LLFontGL::VCENTER, // centered around the position - LLFontGL::NORMAL, // normal text (not bold, italics, etc.) - LLFontGL::DROP_SHADOW_SOFT, - badge_char_length, badge_pixel_length, - right_position_out, do_not_use_ellipses); + mFontBuffer.render(mGLFont, + mLabel.getWString(), + badge_label_begin_offset, + badge_center_x + mLabelOffsetHoriz, + badge_center_y + mLabelOffsetVert, + mLabelColor % alpha, + LLFontGL::HCENTER, LLFontGL::VCENTER, // centered around the position + LLFontGL::NORMAL, // normal text (not bold, italics, etc.) + LLFontGL::DROP_SHADOW_SOFT, + badge_char_length, badge_pixel_length, + right_position_out, do_not_use_ellipses); } } } |