FIRE-8882: Make new snap behavior optional and default to the old behavior
parent
299b415513
commit
240a358486
|
|
@ -19703,5 +19703,16 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<integer>1</integer>
|
||||
</map>
|
||||
<!-- <FS:Zi> -->
|
||||
<key>FSSnapDomain</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Controls whether to snap inside or outside build ruler and ring (0 = Inside, 1 = Outside)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
</map>
|
||||
</llsd>
|
||||
|
|
|
|||
|
|
@ -34,6 +34,11 @@
|
|||
#include "llfloaterbuildoptions.h"
|
||||
#include "lluictrlfactory.h"
|
||||
|
||||
// <FS:CR> FIRE-8882
|
||||
#include "llcombobox.h"
|
||||
#include "llviewercontrol.h"
|
||||
// </FS:CR>
|
||||
|
||||
//
|
||||
// Methods
|
||||
//
|
||||
|
|
@ -44,4 +49,12 @@ LLFloaterBuildOptions::LLFloaterBuildOptions(const LLSD& key)
|
|||
|
||||
LLFloaterBuildOptions::~LLFloaterBuildOptions()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// <FS:CR> FIRE-8882
|
||||
BOOL LLFloaterBuildOptions::postBuild()
|
||||
{
|
||||
getChild<LLComboBox>("combo_snap_domain")->setValue(gSavedSettings.getBOOL("FSSnapDomain"));
|
||||
return TRUE;
|
||||
}
|
||||
// </FS:CR>
|
||||
|
|
|
|||
|
|
@ -42,6 +42,9 @@ class LLFloaterBuildOptions
|
|||
private:
|
||||
LLFloaterBuildOptions(const LLSD& key);
|
||||
~LLFloaterBuildOptions();
|
||||
// <FS:CR> FIRE-8882
|
||||
BOOL postBuild();
|
||||
// </FS:CR>
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -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)
|
||||
// <FS:CR> 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)))
|
||||
// </FS:CR>
|
||||
{
|
||||
// <FS:CR> FIRE-8882
|
||||
//if (!mInSnapRegime)
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
// <FS:CR> 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)))
|
||||
// </FS:CR>
|
||||
{
|
||||
mInSnapRegime = TRUE;
|
||||
|
|
|
|||
|
|
@ -558,7 +558,9 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
|
|||
{
|
||||
// <FS:CR> 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))
|
||||
// </FS:CR>
|
||||
{
|
||||
mInSnapRegime = TRUE;
|
||||
|
|
@ -1568,7 +1570,8 @@ void LLManipTranslate::renderSnapGuides()
|
|||
|
||||
float a = line_alpha;
|
||||
|
||||
LLColor4 col = LLUIColorTable::instance().getColor("SilhouetteChildColor");
|
||||
// <FS:CR> Unused variable since 2012-1-14
|
||||
//LLColor4 col = LLUIColorTable::instance().getColor("SilhouetteChildColor");
|
||||
{
|
||||
//draw grid behind objects
|
||||
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
|
||||
|
|
|
|||
|
|
@ -8,20 +8,43 @@
|
|||
save_rect="true"
|
||||
title="Grid Options"
|
||||
width="264">
|
||||
<text
|
||||
type="string"
|
||||
length="1"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
name="snap_to_label"
|
||||
top_pad="20"
|
||||
width="110">
|
||||
Snap To:
|
||||
</text>
|
||||
<combo_box
|
||||
control_name="FSSnapDomain"
|
||||
left_pad="3"
|
||||
height="18"
|
||||
width="120"
|
||||
allow_text_entry="false"
|
||||
follows="left|top"
|
||||
name="combo_snap_domain">
|
||||
<combo_item name="Inside" value="0" label="Snap on Inside"/>
|
||||
<combo_item name="Outside" value="1" label="Snap on Outside"/>
|
||||
</combo_box>
|
||||
<spinner
|
||||
control_name="GridResolution"
|
||||
follows="left|top"
|
||||
height="23"
|
||||
initial_value="1"
|
||||
label="Units (meters)"
|
||||
label_width="130"
|
||||
label_width="160"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
max_val="5"
|
||||
min_val="0.01"
|
||||
name="GridResolution"
|
||||
top_pad="30"
|
||||
width="200" />
|
||||
top_pad="3"
|
||||
width="233" />
|
||||
<spinner
|
||||
control_name="GridDrawSize"
|
||||
decimal_digits="1"
|
||||
|
|
@ -30,14 +53,14 @@
|
|||
increment="0.5"
|
||||
initial_value="5"
|
||||
label="Extents (meters)"
|
||||
label_width="130"
|
||||
label_width="160"
|
||||
layout="topleft"
|
||||
left_delta="0"
|
||||
max_val="50"
|
||||
min_val="1"
|
||||
name="GridDrawSize"
|
||||
top_pad="0"
|
||||
width="200" />
|
||||
width="233" />
|
||||
<check_box
|
||||
control_name="GridSubUnit"
|
||||
height="16"
|
||||
|
|
@ -77,5 +100,5 @@
|
|||
name="GridOpacity"
|
||||
show_text="false"
|
||||
top_pad="0"
|
||||
width="210" />
|
||||
width="240" />
|
||||
</floater>
|
||||
|
|
|
|||
Loading…
Reference in New Issue