MAINT-8382 FIXED ?Zoom back? button is displayed after selecting other nearby media

Tue, 13 Mar 2018 18:31:27 +0200

author
maxim_productengine<mnikolenko@productengine.com>
date
Tue, 13 Mar 2018 18:31:27 +0200
changeset 55342
0f210bf34c09
parent 55336
5c65f763f4e4
child 55343
81acf655cb56

MAINT-8382 FIXED ?Zoom back? button is displayed after selecting other nearby media

indra/newview/llpanelnearbymedia.cpp file | annotate | diff | revisions
indra/newview/llviewermediafocus.cpp file | annotate | diff | revisions
indra/newview/llviewermediafocus.h file | annotate | diff | revisions
     1.1 --- a/indra/newview/llpanelnearbymedia.cpp	Tue Feb 13 15:40:21 2018 +0200
     1.2 +++ b/indra/newview/llpanelnearbymedia.cpp	Tue Mar 13 18:31:27 2018 +0200
     1.3 @@ -1047,7 +1047,7 @@
     1.4  			else {
     1.5  				showBasicControls(!impl->isMediaDisabled(), 
     1.6  								  ! impl->isParcelMedia(),  // include_zoom
     1.7 -								  LLViewerMediaFocus::getInstance()->isZoomed(),
     1.8 +								  LLViewerMediaFocus::getInstance()->isZoomedOnMedia(impl->getMediaTextureID()),
     1.9  								  impl->getVolume() == 0.0,
    1.10  								  impl->getVolume());
    1.11  			}
     2.1 --- a/indra/newview/llviewermediafocus.cpp	Tue Feb 13 15:40:21 2018 +0200
     2.2 +++ b/indra/newview/llviewermediafocus.cpp	Tue Mar 13 18:31:27 2018 +0200
     2.3 @@ -82,7 +82,7 @@
     2.4  	if (media_impl.notNull() && objectp.notNull())
     2.5  	{
     2.6  		bool face_auto_zoom = false;
     2.7 -
     2.8 +		mPrevFocusedImplID = LLUUID::null;
     2.9  		mFocusedImplID = media_impl->getMediaTextureID();
    2.10  		mFocusedObjectID = objectp->getID();
    2.11  		mFocusedObjectFace = face;
    2.12 @@ -403,6 +403,7 @@
    2.13  			else
    2.14  			{
    2.15  				// Someone else has focus -- back off.
    2.16 +				mPrevFocusedImplID = mFocusedImplID;
    2.17  				clearFocus();
    2.18  			}
    2.19  		}
    2.20 @@ -602,6 +603,15 @@
    2.21  	return (mMediaControls.get() && mMediaControls.get()->getZoomLevel() != LLPanelPrimMediaControls::ZOOM_NONE);
    2.22  }
    2.23  
    2.24 +bool LLViewerMediaFocus::isZoomedOnMedia(LLUUID media_id)
    2.25 +{
    2.26 +	if (isZoomed())
    2.27 +	{
    2.28 +		return (mFocusedImplID == media_id) || (mPrevFocusedImplID == media_id);
    2.29 +	}
    2.30 +	return false;
    2.31 +}
    2.32 +
    2.33  LLUUID LLViewerMediaFocus::getControlsMediaID()
    2.34  {
    2.35  	if(getFocusedMediaImpl())
     3.1 --- a/indra/newview/llviewermediafocus.h	Tue Feb 13 15:40:21 2018 +0200
     3.2 +++ b/indra/newview/llviewermediafocus.h	Tue Mar 13 18:31:27 2018 +0200
     3.3 @@ -83,6 +83,7 @@
     3.4  	void focusZoomOnMedia(LLUUID media_id);
     3.5  	// Are we zoomed in?
     3.6  	bool isZoomed() const;
     3.7 +	bool isZoomedOnMedia(LLUUID media_id);
     3.8  	void unZoom();
     3.9  	
    3.10  	// Return the ID of the media instance the controls are currently attached to (either focus or hover).
    3.11 @@ -104,6 +105,7 @@
    3.12  	LLUUID mFocusedObjectID;
    3.13  	S32 mFocusedObjectFace;
    3.14  	LLUUID mFocusedImplID;
    3.15 +	LLUUID mPrevFocusedImplID;
    3.16  	LLVector3 mFocusedObjectNormal;
    3.17  	
    3.18  	LLUUID mHoverObjectID;

mercurial