|
@@ -55,6 +55,8 @@ internal class GodotGestureHandler(private val inputHandler: GodotInputHandler)
|
|
|
*/
|
|
|
var panningAndScalingEnabled = false
|
|
|
|
|
|
+ var scrollDeadzoneDisabled = false
|
|
|
+
|
|
|
private var nextDownIsDoubleTap = false
|
|
|
private var dragInProgress = false
|
|
|
private var scaleInProgress = false
|
|
@@ -153,7 +155,7 @@ internal class GodotGestureHandler(private val inputHandler: GodotInputHandler)
|
|
|
if (contextClickInProgress) {
|
|
|
inputHandler.handleMouseEvent(event, event.actionMasked, MotionEvent.BUTTON_SECONDARY, false)
|
|
|
return true
|
|
|
- } else if (!scaleInProgress) {
|
|
|
+ } else if (scrollDeadzoneDisabled && !scaleInProgress) {
|
|
|
// The 'onScroll' event is triggered with a long delay.
|
|
|
// Force the 'InputEventScreenDrag' event earlier here.
|
|
|
// We don't toggle 'dragInProgress' here so that the scaling logic can override the drag operation if needed.
|
|
@@ -191,7 +193,7 @@ internal class GodotGestureHandler(private val inputHandler: GodotInputHandler)
|
|
|
distanceY: Float
|
|
|
): Boolean {
|
|
|
if (scaleInProgress) {
|
|
|
- if (dragInProgress || lastDragX != 0.0f || lastDragY != 0.0f) {
|
|
|
+ if (dragInProgress || (scrollDeadzoneDisabled && (lastDragX != 0.0f || lastDragY != 0.0f))) {
|
|
|
if (originEvent != null) {
|
|
|
// Cancel the drag
|
|
|
inputHandler.handleMotionEvent(originEvent, MotionEvent.ACTION_CANCEL)
|