diff options
author | Ricky Curtice <kf6kjg+hg@gmail.com> | 2014-03-02 15:49:17 -0800 |
---|---|---|
committer | Ricky Curtice <kf6kjg+hg@gmail.com> | 2014-03-02 15:49:17 -0800 |
commit | 871bae45ba2f17b8cc791b3b7dcc443f1eb8cd95 (patch) | |
tree | c4a65dd6f0850a55117a7299f49eb9cdd0727cff /indra/newview/llmanipscale.cpp | |
parent | e8a2d3b73b6985e0e9aa23359c1c34c112681b44 (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-x | indra/newview/llmanipscale.cpp | 6 |
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); |