summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpanelnearbymedia.cpp2
-rw-r--r--indra/newview/llviewermediafocus.cpp12
-rw-r--r--indra/newview/llviewermediafocus.h2
3 files changed, 14 insertions, 2 deletions
diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp
index 737ae2e32d..4d37d8ea4f 100644
--- a/indra/newview/llpanelnearbymedia.cpp
+++ b/indra/newview/llpanelnearbymedia.cpp
@@ -1047,7 +1047,7 @@ void LLPanelNearByMedia::updateControls()
else {
showBasicControls(!impl->isMediaDisabled(),
! impl->isParcelMedia(), // include_zoom
- LLViewerMediaFocus::getInstance()->isZoomed(),
+ LLViewerMediaFocus::getInstance()->isZoomedOnMedia(impl->getMediaTextureID()),
impl->getVolume() == 0.0,
impl->getVolume());
}
diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp
index 7b4df3d3da..59165c1d71 100644
--- a/indra/newview/llviewermediafocus.cpp
+++ b/indra/newview/llviewermediafocus.cpp
@@ -82,7 +82,7 @@ void LLViewerMediaFocus::setFocusFace(LLPointer<LLViewerObject> objectp, S32 fac
if (media_impl.notNull() && objectp.notNull())
{
bool face_auto_zoom = false;
-
+ mPrevFocusedImplID = LLUUID::null;
mFocusedImplID = media_impl->getMediaTextureID();
mFocusedObjectID = objectp->getID();
mFocusedObjectFace = face;
@@ -403,6 +403,7 @@ void LLViewerMediaFocus::update()
else
{
// Someone else has focus -- back off.
+ mPrevFocusedImplID = mFocusedImplID;
clearFocus();
}
}
@@ -602,6 +603,15 @@ bool LLViewerMediaFocus::isZoomed() const
return (mMediaControls.get() && mMediaControls.get()->getZoomLevel() != LLPanelPrimMediaControls::ZOOM_NONE);
}
+bool LLViewerMediaFocus::isZoomedOnMedia(LLUUID media_id)
+{
+ if (isZoomed())
+ {
+ return (mFocusedImplID == media_id) || (mPrevFocusedImplID == media_id);
+ }
+ return false;
+}
+
LLUUID LLViewerMediaFocus::getControlsMediaID()
{
if(getFocusedMediaImpl())
diff --git a/indra/newview/llviewermediafocus.h b/indra/newview/llviewermediafocus.h
index 368c671f84..763a6c1688 100644
--- a/indra/newview/llviewermediafocus.h
+++ b/indra/newview/llviewermediafocus.h
@@ -83,6 +83,7 @@ public:
void focusZoomOnMedia(LLUUID media_id);
// Are we zoomed in?
bool isZoomed() const;
+ bool isZoomedOnMedia(LLUUID media_id);
void unZoom();
// Return the ID of the media instance the controls are currently attached to (either focus or hover).
@@ -104,6 +105,7 @@ private:
LLUUID mFocusedObjectID;
S32 mFocusedObjectFace;
LLUUID mFocusedImplID;
+ LLUUID mPrevFocusedImplID;
LLVector3 mFocusedObjectNormal;
LLUUID mHoverObjectID;