diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2017-06-10 16:35:35 +0000 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2017-06-10 16:35:35 +0000 |
commit | da91a1506cd7c3072c38a8e276e3584822926eed (patch) | |
tree | a93931fa64508cef2557ed658e7fc667ad1ad103 | |
parent | d15e8577773b9afb92c232c757b89343c93d56bf (diff) | |
parent | e4c262ec5e5636c47fe1df4f5f4bf2f1b1e06891 (diff) |
Merged in MAINT-321
-rw-r--r-- | indra/newview/lltoolgrab.cpp | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index 5623036b91..f3e661e71a 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -478,38 +478,52 @@ void LLToolGrabBase::handleHoverActive(S32 x, S32 y, MASK mask) } //-------------------------------------------------- + // Determine target mode + //-------------------------------------------------- + bool vertical_dragging = false; + bool spin_grabbing = false; + if ((mask == MASK_VERTICAL) + || (gGrabBtnVertical && (mask != MASK_SPIN))) + { + vertical_dragging = TRUE; + } + else if ((mask == MASK_SPIN) + || (gGrabBtnSpin && (mask != MASK_VERTICAL))) + { + spin_grabbing = TRUE; + } + + //-------------------------------------------------- // Toggle spinning //-------------------------------------------------- - if (mSpinGrabbing && !(mask == MASK_SPIN) && !gGrabBtnSpin) + if (mSpinGrabbing && !spin_grabbing) { - // user released ALT key, stop spinning + // user released or switched mask key(s), stop spinning stopSpin(); } - else if (!mSpinGrabbing && (mask == MASK_SPIN) ) + else if (!mSpinGrabbing && spin_grabbing) { - // user pressed ALT key, start spinning + // user pressed mask key(s), start spinning startSpin(); } + mSpinGrabbing = spin_grabbing; //-------------------------------------------------- // Toggle vertical dragging //-------------------------------------------------- - if (mVerticalDragging && !(mask == MASK_VERTICAL) && !gGrabBtnVertical) + if (mVerticalDragging && !vertical_dragging) { // ...switch to horizontal dragging - mVerticalDragging = FALSE; - mDragStartPointGlobal = gViewerWindow->clickPointInWorldGlobal(x, y, objectp); mDragStartFromCamera = mDragStartPointGlobal - gAgentCamera.getCameraPositionGlobal(); } - else if (!mVerticalDragging && (mask == MASK_VERTICAL) ) + else if (!mVerticalDragging && vertical_dragging) { // ...switch to vertical dragging - mVerticalDragging = TRUE; - mDragStartPointGlobal = gViewerWindow->clickPointInWorldGlobal(x, y, objectp); mDragStartFromCamera = mDragStartPointGlobal - gAgentCamera.getCameraPositionGlobal(); } + mVerticalDragging = vertical_dragging; const F32 RADIANS_PER_PIXEL_X = 0.01f; const F32 RADIANS_PER_PIXEL_Y = 0.01f; @@ -755,12 +769,13 @@ void LLToolGrabBase::handleHoverNonPhysical(S32 x, S32 y, MASK mask) //-------------------------------------------------- // Toggle vertical dragging //-------------------------------------------------- - if (mVerticalDragging && !(mask == MASK_VERTICAL) && !gGrabBtnVertical) + if (!(mask == MASK_VERTICAL) && !gGrabBtnVertical) { mVerticalDragging = FALSE; } - else if (!mVerticalDragging && (mask == MASK_VERTICAL) ) + else if ((gGrabBtnVertical && (mask != MASK_SPIN)) + || (mask == MASK_VERTICAL)) { mVerticalDragging = TRUE; } |