From c1fe3a3ed6aca0e0439a4f0d1116a31e9999a495 Mon Sep 17 00:00:00 2001
From: Mnikolenko ProductEngine <mnikolenko@productengine.com>
Date: Thu, 18 Sep 2014 11:46:36 +0300
Subject: [PATCH] MAINT-4433 FIXED Don't start changing scale on first click.

---
 indra/newview/llmanipscale.cpp | 14 +++++++++++++-
 indra/newview/llmanipscale.h   |  3 +++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp
index 2810941d83c..cb505c9d4c9 100755
--- a/indra/newview/llmanipscale.cpp
+++ b/indra/newview/llmanipscale.cpp
@@ -352,6 +352,10 @@ BOOL LLManipScale::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
 
 	updateSnapGuides(bbox);
 
+	mFirstClickX = x;
+	mFirstClickY = y;
+	mIsFirstClick = true;
+
 	mDragStartPointGlobal = gAgent.getPosGlobalFromAgent(box_corner_agent);
 	mDragStartCenterGlobal = gAgent.getPosGlobalFromAgent(box_center_agent);
 	LLVector3 far_corner_agent = bbox.localToAgent( unitVectorToLocalBBoxExtent( -1.f * partToUnitVector( mManipPart ), bbox ) );
@@ -415,7 +419,15 @@ BOOL LLManipScale::handleHover(S32 x, S32 y, MASK mask)
 		}
 		else
 		{
-			drag( x, y );
+			if((mFirstClickX != x) || (mFirstClickY != y))
+			{
+				mIsFirstClick = false;
+			}
+
+			if(!mIsFirstClick)
+			{
+				drag( x, y );
+			}
 		}
 		LL_DEBUGS("UserInput") << "hover handled by LLManipScale (active)" << LL_ENDL;		
 	}
diff --git a/indra/newview/llmanipscale.h b/indra/newview/llmanipscale.h
index 7cc3c998109..e93b3d4f839 100755
--- a/indra/newview/llmanipscale.h
+++ b/indra/newview/llmanipscale.h
@@ -172,6 +172,9 @@ class LLManipScale : public LLManip
 	ESnapRegimes	mSnapRegime; //<! Which, if any, snap regime the cursor is currently residing in.
 	F32				mManipulatorScales[NUM_MANIPULATORS];
 	F32				mBoxHandleSize[NUM_MANIPULATORS];		// The size of the handles at the corners of the bounding box
+	S32				mFirstClickX;
+	S32				mFirstClickY;
+	bool			mIsFirstClick;
 };
 
 #endif  // LL_MANIPSCALE_H
-- 
GitLab