summaryrefslogtreecommitdiff
path: root/indra/newview/llmanipscale.cpp
diff options
context:
space:
mode:
authorRicky Curtice <kf6kjg+hg@gmail.com>2014-03-02 15:49:17 -0800
committerRicky Curtice <kf6kjg+hg@gmail.com>2014-03-02 15:49:17 -0800
commit871bae45ba2f17b8cc791b3b7dcc443f1eb8cd95 (patch)
treec4a65dd6f0850a55117a7299f49eb9cdd0727cff /indra/newview/llmanipscale.cpp
parente8a2d3b73b6985e0e9aa23359c1c34c112681b44 (diff)
STORM-1920: From Richard, fix for scale sliding when mouse goes in the opposite direction of the scale.
I had discovered a set of bugs in the fix he sent me involving when the user decided to move the mouse in the opposite direction. This fixes the bug where the scale would start sliding around.
Diffstat (limited to 'indra/newview/llmanipscale.cpp')
-rwxr-xr-xindra/newview/llmanipscale.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp
index ea4235efde..af9fe385b2 100755
--- a/indra/newview/llmanipscale.cpp
+++ b/indra/newview/llmanipscale.cpp
@@ -1612,14 +1612,14 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
{
LLGLDepthTest gls_depth(GL_FALSE);
- F32 dist_grid_axis = (drag_point - mScaleCenter) * mScaleDir;
+ F32 dist_grid_axis = llmax(0.f, (drag_point - mScaleCenter) * mScaleDir);
F32 smallest_subdivision1 = mScaleSnapUnit1 / sGridMaxSubdivisionLevel;
F32 smallest_subdivision2 = mScaleSnapUnit2 / sGridMaxSubdivisionLevel;
// find distance to nearest smallest grid unit
- F32 grid_multiple1 = llfloor(llmax(0.f, dist_grid_axis) / smallest_subdivision1);
- F32 grid_multiple2 = llfloor(llmax(0.f, dist_grid_axis) / smallest_subdivision2);
+ F32 grid_multiple1 = llfloor(dist_grid_axis / smallest_subdivision1);
+ F32 grid_multiple2 = llfloor(dist_grid_axis / smallest_subdivision2);
F32 grid_offset1 = fmodf(dist_grid_axis, smallest_subdivision1);
F32 grid_offset2 = fmodf(dist_grid_axis, smallest_subdivision2);