summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatercamera.cpp
diff options
context:
space:
mode:
authorSamuel Kolb <skolb@lindenlab.com>2009-11-30 09:11:04 -0800
committerSamuel Kolb <skolb@lindenlab.com>2009-11-30 09:11:04 -0800
commite2699c64a20262f6fbe6c1432294e8428e8cda5d (patch)
tree5b14a249342021b220df723a91c3e78d2c91f06e /indra/newview/llfloatercamera.cpp
parent6824800fa0001cd4a23a4f98b099af34435b0e06 (diff)
parentd4e01315e3f39dd14bb2c14f09e4e94749542b06 (diff)
merge viewer-2-0 into media
Diffstat (limited to 'indra/newview/llfloatercamera.cpp')
-rw-r--r--indra/newview/llfloatercamera.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp
index 92e958b32d..764aff68c9 100644
--- a/indra/newview/llfloatercamera.cpp
+++ b/indra/newview/llfloatercamera.cpp
@@ -215,17 +215,38 @@ void LLFloaterCamera::onOpen(const LLSD& key)
getDockTongue(), LLDockControl::TOP));
mZoom->onOpen(key);
+
+ // Returns to previous mode, see EXT-2727(View tool should remember state).
+ // In case floater was just hidden and it isn't reset the mode
+ // just update state to current one. Else go to previous.
+ if ( !mClosed )
+ updateState();
+ else
+ toPrevMode();
+ mClosed = FALSE;
}
void LLFloaterCamera::onClose(bool app_quitting)
{
//We don't care of camera mode if app is quitting
- if(!app_quitting)
- switchMode(CAMERA_CTRL_MODE_ORBIT);
+ if(app_quitting)
+ return;
+ // When mCurrMode is in CAMERA_CTRL_MODE_ORBIT
+ // switchMode won't modify mPrevMode, so force it here.
+ // It is needed to correctly return to previous mode on open, see EXT-2727.
+ if (mCurrMode == CAMERA_CTRL_MODE_ORBIT)
+ mPrevMode = CAMERA_CTRL_MODE_ORBIT;
+
+ // HACK: Should always close as docked to prevent toggleInstance without calling onOpen.
+ if ( !isDocked() )
+ setDocked(true);
+ switchMode(CAMERA_CTRL_MODE_ORBIT);
+ mClosed = TRUE;
}
LLFloaterCamera::LLFloaterCamera(const LLSD& val)
: LLTransientDockableFloater(NULL, true, val),
+ mClosed(FALSE),
mCurrMode(CAMERA_CTRL_MODE_ORBIT),
mPrevMode(CAMERA_CTRL_MODE_ORBIT)
{