diff options
author | Richard Nelson <none@none> | 2010-03-30 16:30:31 -0700 |
---|---|---|
committer | Richard Nelson <none@none> | 2010-03-30 16:30:31 -0700 |
commit | 2bb03e5edb5572de1ea31c66f439c8cde9cd2197 (patch) | |
tree | 3a88a143805f86348881e4fec0a66356c20e82bf | |
parent | 98695056c2fbfb91de805d9e2a01cde23668c4d3 (diff) |
EXT-6525 - drag threshold is very low for navbar favorites
reviewed by Leyla
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | indra/newview/lltooldraganddrop.cpp | 9 |
2 files changed, 17 insertions, 3 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 73fb24e4eb..e62c4fbfc1 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2564,6 +2564,17 @@ <key>Value</key> <real>0.10000000149</real> </map> + <key>DragAndDropDistanceThreshold</key> + <map> + <key>Comment</key> + <string>Number of pixels that mouse should move before triggering drag and drop mode</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>3</integer> + </map> <key>DropShadowButton</key> <map> <key>Comment</key> diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 394f550f2e..f37efd778f 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -412,9 +412,12 @@ void LLToolDragAndDrop::setDragStart(S32 x, S32 y) BOOL LLToolDragAndDrop::isOverThreshold(S32 x,S32 y) { - const S32 MIN_MANHATTAN_DIST = 3; - S32 manhattan_dist = llabs( x - mDragStartX ) + llabs( y - mDragStartY ); - return manhattan_dist >= MIN_MANHATTAN_DIST; + static LLCachedControl<S32> drag_and_drop_threshold(gSavedSettings,"DragAndDropDistanceThreshold"); + + S32 mouse_delta_x = x - mDragStartX; + S32 mouse_delta_y = y - mDragStartY; + + return (mouse_delta_x * mouse_delta_x) + (mouse_delta_y * mouse_delta_y) > drag_and_drop_threshold * drag_and_drop_threshold; } void LLToolDragAndDrop::beginDrag(EDragAndDropType type, |