From 240a3584865bb2d6fc6e1ce942506cd99a946060 Mon Sep 17 00:00:00 2001 From: Cinders Date: Mon, 14 Jan 2013 21:32:48 -0700 Subject: [PATCH] FIRE-8882: Make new snap behavior optional and default to the old behavior --- indra/newview/app_settings/settings.xml | 11 ++++++ indra/newview/llfloaterbuildoptions.cpp | 15 +++++++- indra/newview/llfloaterbuildoptions.h | 3 ++ indra/newview/llmaniprotate.cpp | 9 ++++- indra/newview/llmanipscale.cpp | 8 +++-- indra/newview/llmaniptranslate.cpp | 7 ++-- .../default/xui/en/floater_build_options.xml | 35 +++++++++++++++---- 7 files changed, 75 insertions(+), 13 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 5868fa53a8..8a0d09e5e6 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -19703,5 +19703,16 @@ Change of this parameter will affect the layout of buttons in notification toast 1 + FSSnapDomain + + Comment + Controls whether to snap inside or outside build ruler and ring (0 = Inside, 1 = Outside) + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/llfloaterbuildoptions.cpp b/indra/newview/llfloaterbuildoptions.cpp index 1a0a8a437d..28aa7741de 100644 --- a/indra/newview/llfloaterbuildoptions.cpp +++ b/indra/newview/llfloaterbuildoptions.cpp @@ -34,6 +34,11 @@ #include "llfloaterbuildoptions.h" #include "lluictrlfactory.h" +// FIRE-8882 +#include "llcombobox.h" +#include "llviewercontrol.h" +// + // // Methods // @@ -44,4 +49,12 @@ LLFloaterBuildOptions::LLFloaterBuildOptions(const LLSD& key) LLFloaterBuildOptions::~LLFloaterBuildOptions() { -} \ No newline at end of file +} + +// FIRE-8882 +BOOL LLFloaterBuildOptions::postBuild() +{ + getChild("combo_snap_domain")->setValue(gSavedSettings.getBOOL("FSSnapDomain")); + return TRUE; +} +// diff --git a/indra/newview/llfloaterbuildoptions.h b/indra/newview/llfloaterbuildoptions.h index 632ed1cc76..08b6700864 100644 --- a/indra/newview/llfloaterbuildoptions.h +++ b/indra/newview/llfloaterbuildoptions.h @@ -42,6 +42,9 @@ class LLFloaterBuildOptions private: LLFloaterBuildOptions(const LLSD& key); ~LLFloaterBuildOptions(); +// FIRE-8882 + BOOL postBuild(); +// }; #endif \ No newline at end of file diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index cd57c0ad2a..269d828428 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -1715,7 +1715,14 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) return LLQuaternion::DEFAULT; } - if (gSavedSettings.getBOOL("SnapEnabled") && projected_mouse.magVec() <= SNAP_GUIDE_RING_RADIUS * mRadiusMeters) +// FIRE-8882 + //if (gSavedSettings.getBOOL("SnapEnabled") && projected_mouse.magVec() <= SNAP_GUIDE_RING_RADIUS * mRadiusMeters) + BOOL snap_enabled = gSavedSettings.getBOOL("SnapEnabled"); + BOOL snap_domain = gSavedSettings.getBOOL("FSSnapDomain"); + if (snap_enabled && + ((snap_domain && projected_mouse.magVec() > SNAP_GUIDE_RING_RADIUS * mRadiusMeters) || + (!snap_domain && projected_mouse.magVec() <= SNAP_GUIDE_RING_RADIUS * mRadiusMeters))) +// { // FIRE-8882 //if (!mInSnapRegime) diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 2f7af2965a..e9e7c99658 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -1165,11 +1165,13 @@ void LLManipScale::dragFace( S32 x, S32 y ) F32 dist_from_scale_line = dist_vec(scale_center_to_mouse, (mouse_on_scale_line - mScaleCenter)); F32 dist_along_scale_line = scale_center_to_mouse * mScaleDir; + BOOL snap_enabled = gSavedSettings.getBOOL("SnapEnabled"); // FIRE-8882 - //BOOL snap_enabled = gSavedSettings.getBOOL("SnapEnabled"); - + BOOL snap_domain = gSavedSettings.getBOOL("FSSnapDomain"); //if (snap_enabled && dist_from_scale_line > mSnapRegimeOffset) - if (gSavedSettings.getBOOL("SnapEnabled") && dist_from_scale_line <= mSnapRegimeOffset) + if (snap_enabled && + ((snap_domain && dist_from_scale_line > mSnapRegimeOffset) || + (!snap_domain && dist_from_scale_line <= mSnapRegimeOffset))) // { mInSnapRegime = TRUE; diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index e2bc188801..d6ec84cae5 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -558,7 +558,9 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) { // FIRE-8882 //if (off_axis_magnitude > mSnapOffsetMeters) - if (off_axis_magnitude <= mSnapOffsetMeters) + BOOL snap_domain = gSavedSettings.getBOOL("FSSnapDomain"); + if ((snap_domain && off_axis_magnitude > mSnapOffsetMeters) || + (!snap_domain && off_axis_magnitude <= mSnapOffsetMeters)) // { mInSnapRegime = TRUE; @@ -1568,7 +1570,8 @@ void LLManipTranslate::renderSnapGuides() float a = line_alpha; - LLColor4 col = LLUIColorTable::instance().getColor("SilhouetteChildColor"); + // Unused variable since 2012-1-14 + //LLColor4 col = LLUIColorTable::instance().getColor("SilhouetteChildColor"); { //draw grid behind objects LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); diff --git a/indra/newview/skins/default/xui/en/floater_build_options.xml b/indra/newview/skins/default/xui/en/floater_build_options.xml index db5e1b5de4..f16bb8381c 100644 --- a/indra/newview/skins/default/xui/en/floater_build_options.xml +++ b/indra/newview/skins/default/xui/en/floater_build_options.xml @@ -8,20 +8,43 @@ save_rect="true" title="Grid Options" width="264"> + + Snap To: + + + + + + top_pad="3" + width="233" /> + width="233" /> + width="240" />