summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMnikolenko ProductEngine <mnikolenko@productengine.com>2016-02-23 12:08:29 +0200
committerMnikolenko ProductEngine <mnikolenko@productengine.com>2016-02-23 12:08:29 +0200
commit35b499a0bec95b5a9f0ce8d85d85d6a3c2ae5283 (patch)
treed80320b942c58634e90761df2f58ecb43ce50011
parentb1d8df9ea2ce440b0cb94e87a8816426f99c8336 (diff)
MAINT-6110 Show hovertext on attached objects
-rwxr-xr-xindra/newview/llhudtext.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp
index c87e2fb658..05c8c236e9 100755
--- a/indra/newview/llhudtext.cpp
+++ b/indra/newview/llhudtext.cpp
@@ -384,11 +384,21 @@ void LLHUDText::updateVisibility()
mPositionAgent -= dir_from_camera * mSourceObject->getVObjRadius();
}
- mLastDistance = (mPositionAgent - LLViewerCamera::getInstance()->getOrigin()).magVec();
+ if (!mTextSegments.size())
+ {
+ mVisible = FALSE;
+ return;
+ }
+ mLastDistance = (mPositionAgent - LLViewerCamera::getInstance()->getOrigin()).magVec();
F32 obj_dist = dist_vec(mSourceObject->getPositionEdit(), LLViewerCamera::getInstance()->getOrigin());
- if (!mTextSegments.size() || (mDoFade && (mLastDistance > mFadeDistance + mFadeRange)) || (obj_dist > MAX_DRAW_DISTANCE))
+ if(mSourceObject->isAttachment())
+ {
+ LLViewerObject* parent = (LLViewerObject*)mSourceObject->getRoot();
+ obj_dist = dist_vec(parent->getPositionEdit(), LLViewerCamera::getInstance()->getOrigin());
+ }
+ if ((mDoFade && (mLastDistance > mFadeDistance + mFadeRange)) || (obj_dist > MAX_DRAW_DISTANCE))
{
mVisible = FALSE;
return;