summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolgrab.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2017-09-22 09:18:34 -0700
committerRider Linden <rider@lindenlab.com>2017-09-22 09:18:34 -0700
commit5d3599f5d155dc112c8f05197c8fc73397084e71 (patch)
tree1b67cdb5944a222c1de6de3b974caea78a019762 /indra/newview/lltoolgrab.cpp
parent150fba7c5cd24ad9ab343e762bfd15032e6a9462 (diff)
parent38d9454cbf30f470a723d912be2080f63ae3fa47 (diff)
Merge
Diffstat (limited to 'indra/newview/lltoolgrab.cpp')
-rw-r--r--indra/newview/lltoolgrab.cpp39
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;
}