diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2009-11-24 14:39:39 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2009-11-24 14:39:39 -0500 |
commit | c812c616ea0ba6531b3fe7f75efc815081cd0c2e (patch) | |
tree | 2d966b5ba9fae58a3369055fadd6192b417c7f46 /indra/newview/llviewermediafocus.cpp | |
parent | fc6cfc27bec61ac1f66c1304cc7b54f19157584e (diff) | |
parent | a22bb00530bb779d8e5bb40b68e55767604d88dc (diff) |
merge
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llviewermediafocus.cpp')
-rw-r--r-- | indra/newview/llviewermediafocus.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
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(); } } |