summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-02-10 07:21:34 +0000
committerTofu Linden <tofu.linden@lindenlab.com>2010-02-10 07:21:34 +0000
commita4ef5e2b0d4e36aa98f2e4074f4ddd4cad3d3106 (patch)
treecd05fd1a94494a90e1ed6f10e5a451e86b164443 /indra/newview/llviewermenu.cpp
parent3eadfd1502a8dcb3e04a9455edf24ae54402317a (diff)
parent22dccc74a8fbcf3231d932db39781727833b9259 (diff)
merge from viewer2 trunk.
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index d860bba8b3..d4ec33f282 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;
}