diff options
Diffstat (limited to 'indra/llui/llbadge.cpp')
-rw-r--r-- | indra/llui/llbadge.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp index 42726de0ad..589b75ab5b 100644 --- a/indra/llui/llbadge.cpp +++ b/indra/llui/llbadge.cpp @@ -102,6 +102,7 @@ LLBadge::LLBadge(const LLBadge::Params& p) , mPaddingHoriz(p.padding_horiz) , mPaddingVert(p.padding_vert) , mParentScroller(NULL) + , mDrawAtParentTop(false) { if (mImage.isNull()) { @@ -224,7 +225,7 @@ void LLBadge::draw() { LLView* owner_view = mOwner.get(); - if (owner_view) + if (owner_view && owner_view->isInVisibleChain()) { // // Calculate badge size based on label text @@ -307,7 +308,14 @@ void LLBadge::draw() // Compute y position if (mLocationOffsetVCenter == BADGE_OFFSET_NOT_SPECIFIED) { - badge_center_y = owner_rect.mBottom + owner_rect.getHeight() * mLocationPercentVCenter; + if(mDrawAtParentTop) + { + badge_center_y = owner_rect.mTop - badge_height * 0.5f - 1; + } + else + { + badge_center_y = owner_rect.mBottom + owner_rect.getHeight() * mLocationPercentVCenter; + } } else { |