diff options
author | Aimee Linden <aimee@lindenlab.com> | 2010-02-11 14:53:11 +0000 |
---|---|---|
committer | Aimee Linden <aimee@lindenlab.com> | 2010-02-11 14:53:11 +0000 |
commit | d7e8a30a5a9bd416254f83e20054c73edf3f890d (patch) | |
tree | 43a156ca397913ce7da626ac9c002e1036f2460c /indra/newview/llviewermenu.cpp | |
parent | 898e9da1af113704e2e10328dfa5396deb24eb30 (diff) | |
parent | 1b8a7fdeaab78216baad1f916e9788c0b90287b3 (diff) |
merge with ssh://hg.lindenlab.com/viewer/viewer-2-0
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a83baf7f9a..8aae90ec3c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5332,7 +5332,7 @@ class LLWorldCreateLandmark : public view_listener_t void handle_look_at_selection(const LLSD& param) { - const F32 PADDING_FACTOR = 2.f; + const F32 PADDING_FACTOR = 1.75f; BOOL zoom = (param.asString() == "zoom"); if (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) { @@ -5352,14 +5352,19 @@ void handle_look_at_selection(const LLSD& param) } if (zoom) { + // Make sure we are not increasing the distance between the camera and object + LLVector3d orig_distance = gAgent.getCameraPositionGlobal() - LLSelectMgr::getInstance()->getSelectionCenterGlobal(); + distance = llmin(distance, (F32) orig_distance.length()); + gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance), - LLSelectMgr::getInstance()->getSelectionCenterGlobal(), - object_id ); + LLSelectMgr::getInstance()->getSelectionCenterGlobal(), + object_id ); + } else { gAgent.setFocusGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal(), object_id ); - } + } } } @@ -5625,14 +5630,15 @@ class LLShowSidetrayPanel : public view_listener_t bool handleEvent(const LLSD& userdata) { std::string panel_name = userdata.asString(); - // Open up either the sidepanel or new floater. - if (LLSideTray::getInstance()->isPanelActive(panel_name)) + // Toggle the panel + if (!LLSideTray::getInstance()->isPanelActive(panel_name)) { - LLFloaterInventory::showAgentInventory(); + // LLFloaterInventory::showAgentInventory(); + LLSideTray::getInstance()->showPanel(panel_name, LLSD()); } else { - LLSideTray::getInstance()->showPanel(panel_name, LLSD()); + LLSideTray::getInstance()->collapseSideBar(); } return true; } |