summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpanelprimmediacontrols.cpp16
-rw-r--r--indra/newview/llpanelprimmediacontrols.h2
-rw-r--r--indra/newview/llviewermediafocus.cpp28
3 files changed, 36 insertions, 10 deletions
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp
index aca0e1d5c7..529912929d 100644
--- a/indra/newview/llpanelprimmediacontrols.cpp
+++ b/indra/newview/llpanelprimmediacontrols.cpp
@@ -782,8 +782,8 @@ void LLPanelPrimMediaControls::onClickClose()
void LLPanelPrimMediaControls::close()
{
+ resetZoomLevel(true);
LLViewerMediaFocus::getInstance()->clearFocus();
- resetZoomLevel();
setVisible(FALSE);
}
@@ -921,8 +921,11 @@ void LLPanelPrimMediaControls::onClickSkipForward()
void LLPanelPrimMediaControls::onClickZoom()
{
focusOnTarget();
-
- nextZoomLevel();
+
+ if(mCurrentZoom == ZOOM_NONE)
+ {
+ nextZoomLevel();
+ }
}
void LLPanelPrimMediaControls::nextZoomLevel()
@@ -941,12 +944,15 @@ void LLPanelPrimMediaControls::nextZoomLevel()
updateZoom();
}
-void LLPanelPrimMediaControls::resetZoomLevel()
+void LLPanelPrimMediaControls::resetZoomLevel(bool reset_camera)
{
if(mCurrentZoom != ZOOM_NONE)
{
mCurrentZoom = ZOOM_NONE;
- updateZoom();
+ if(reset_camera)
+ {
+ updateZoom();
+ }
}
}
diff --git a/indra/newview/llpanelprimmediacontrols.h b/indra/newview/llpanelprimmediacontrols.h
index 54fc4e343f..accfb72a04 100644
--- a/indra/newview/llpanelprimmediacontrols.h
+++ b/indra/newview/llpanelprimmediacontrols.h
@@ -58,7 +58,7 @@ public:
void updateShape();
bool isMouseOver();
void nextZoomLevel();
- void resetZoomLevel();
+ void resetZoomLevel(bool reset_camera = true);
void close();
LLHandle<LLPanelPrimMediaControls> getHandle() const { return mPanelHandle; }
diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp
index 70a7d835a3..fd74c9c2fc 100644
--- a/indra/newview/llviewermediafocus.cpp
+++ b/indra/newview/llviewermediafocus.cpp
@@ -120,10 +120,20 @@ void LLViewerMediaFocus::setFocusFace(LLPointer<LLViewerObject> objectp, S32 fac
// We must do this before processing the media HUD zoom, or it may zoom to the wrong face.
update();
- if(mMediaControls.get() && face_auto_zoom && ! parcel->getMediaPreventCameraZoom())
+ if(mMediaControls.get())
{
- mMediaControls.get()->resetZoomLevel();
- mMediaControls.get()->nextZoomLevel();
+ if(face_auto_zoom && ! parcel->getMediaPreventCameraZoom())
+ {
+ // Zoom in on this face
+ mMediaControls.get()->resetZoomLevel();
+ mMediaControls.get()->nextZoomLevel();
+ }
+ else
+ {
+ // Reset the controls' zoom level without moving the camera.
+ // This fixes the case where clicking focus between two non-autozoom faces doesn't change the zoom-out button back to a zoom-in button.
+ mMediaControls.get()->resetZoomLevel(false);
+ }
}
}
else
@@ -132,7 +142,8 @@ void LLViewerMediaFocus::setFocusFace(LLPointer<LLViewerObject> objectp, S32 fac
{
if(mMediaControls.get())
{
- mMediaControls.get()->resetZoomLevel();
+ // Don't reset camera zoom by default, just tell the controls they're no longer controlling zoom.
+ mMediaControls.get()->resetZoomLevel(false);
}
}
@@ -292,6 +303,15 @@ BOOL LLViewerMediaFocus::handleKey(KEY key, MASK mask, BOOL called_from_parent)
if (key == KEY_ESCAPE)
{
+ // Reset camera zoom in this case.
+ if(mFocusedImplID.notNull())
+ {
+ if(mMediaControls.get())
+ {
+ mMediaControls.get()->resetZoomLevel(true);
+ }
+ }
+
clearFocus();
}
}