summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindra/newview/llmanipscale.cpp13
-rwxr-xr-xindra/newview/llmanipscale.h12
2 files changed, 13 insertions, 12 deletions
diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp
index 087f617bbb..18201f9074 100755
--- a/indra/newview/llmanipscale.cpp
+++ b/indra/newview/llmanipscale.cpp
@@ -870,7 +870,7 @@ void LLManipScale::dragCorner( S32 x, S32 y )
}
mDragPointGlobal = lerp(mDragStartCenterGlobal, mDragStartPointGlobal, t);
- LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection();
+ LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection();
F32 scale_factor = 1.f;
F32 max_scale = partToMaxScale(mManipPart, bbox);
F32 min_scale = partToMinScale(mManipPart, bbox);
@@ -888,9 +888,6 @@ void LLManipScale::dragCorner( S32 x, S32 y )
LLVector3 projected_drag_pos1 = inverse_projected_vec(mScaleDir, orthogonal_component(mouse_on_plane1, mSnapGuideDir1));
LLVector3 projected_drag_pos2 = inverse_projected_vec(mScaleDir, orthogonal_component(mouse_on_plane2, mSnapGuideDir2));
- LLVector3 mouse_offset_from_scale_line_1 = orthogonal_component(mouse_on_plane1, mScaleDir);
- LLVector3 mouse_offset_from_scale_line_2 = orthogonal_component(mouse_on_plane2, mScaleDir);
-
BOOL snap_enabled = gSavedSettings.getBOOL("SnapEnabled");
if (snap_enabled && (mouse_on_plane1 - projected_drag_pos1) * mSnapGuideDir1 > mSnapRegimeOffset)
{
@@ -1729,7 +1726,9 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
F32 text_highlight = 0.8f;
- if (is_approx_equal(tick_val, mScaleSnapValue) && mInSnapRegime)
+ F32 measured_distance = -(mSnapGuideDir2 * (mScaleDir * mScaleSnapValue)); // The other snap guide points down the vector we are measuring against, which when the snapvalue along the scale direction is projected against gives the distance along the relevant axis of measurement.
+
+ if (is_approx_equal(tick_val, measured_distance) && mInSnapRegime)
{
text_highlight = 1.f;
}
@@ -1781,7 +1780,9 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
F32 text_highlight = 0.8f;
- if (is_approx_equal(tick_val, mScaleSnapValue) && mInSnapRegime)
+ F32 measured_distance = -(mSnapGuideDir1 * (mScaleDir * mScaleSnapValue)); // The other snap guide points down the vector we are measuring against, which when the snapvalue along the scale direction is projected against gives the distance along the relevant axis of measurement.
+
+ if (is_approx_equal(tick_val, measured_distance) && mInSnapRegime)
{
text_highlight = 1.f;
}
diff --git a/indra/newview/llmanipscale.h b/indra/newview/llmanipscale.h
index 5cb8898fd0..652b90d59e 100755
--- a/indra/newview/llmanipscale.h
+++ b/indra/newview/llmanipscale.h
@@ -148,10 +148,10 @@ private:
typedef std::set<ManipulatorHandle*, compare_manipulators> minpulator_list_t;
minpulator_list_t mProjectedManipulators;
LLVector4 mManipulatorVertices[14];
- F32 mScaleSnapUnit1; // size of snap multiples for axis 1
- F32 mScaleSnapUnit2; // size of snap multiples for axis 2
- LLVector3 mScalePlaneNormal1; // normal of plane in which scale occurs that most faces camera
- LLVector3 mScalePlaneNormal2; // normal of plane in which scale occurs that most faces camera
+ F32 mScaleSnapUnit1; //!< Size of snap multiples for axis 1.
+ F32 mScaleSnapUnit2; //!< Size of snap multiples for axis 2.
+ LLVector3 mScalePlaneNormal1; //!< Normal of plane in which scale occurs that most faces camera.
+ LLVector3 mScalePlaneNormal2; //!< Normal of plane in which scale occurs that most faces camera.
LLVector3 mSnapGuideDir1;
LLVector3 mSnapGuideDir2;
LLVector3 mSnapDir1;
@@ -159,8 +159,8 @@ private:
F32 mSnapRegimeOffset;
F32 mSnapGuideLength;
LLVector3 mScaleCenter;
- LLVector3 mScaleDir;
- F32 mScaleSnapValue;
+ LLVector3 mScaleDir; //!< The direction of the scaling action. In face-dragging this is aligned with one of the cardinal axis relative to the prim, but in corner-dragging this is along the diagonal.
+ F32 mScaleSnapValue; //!< The distance of the current position nearest the mouse location, measured along mScaleDir. Is measured either from the center or from the far face/corner depending upon whether uniform scaling is true or false respectively.
BOOL mInSnapRegime;
F32* mManipulatorScales;
};