From 871bae45ba2f17b8cc791b3b7dcc443f1eb8cd95 Mon Sep 17 00:00:00 2001 From: Ricky Curtice Date: Sun, 2 Mar 2014 15:49:17 -0800 Subject: 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. --- indra/newview/llmanipscale.cpp | 6 +++--- 1 file 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); -- cgit v1.2.3