Skip to content

Commit 4241130

Browse files
author
Rene Damm
authored
FIX: Tap/swipe gesture detection in TouchSamples (#911).
1 parent 1eec32e commit 4241130

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ExternalSampleProjects/TouchSamples/Assets/Scripts/Gestures/GestureController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ protected virtual void Awake()
7878
private bool IsValidSwipe(ref ActiveGesture gesture)
7979
{
8080
return gesture.TravelDistance >= minSwipeDistance &&
81-
(gesture.StartTime - gesture.EndTime) <= maxSwipeDuration &&
81+
(gesture.EndTime - gesture.StartTime) <= maxSwipeDuration &&
8282
gesture.SwipeDirectionSameness >= swipeDirectionSamenessThreshold;
8383
}
8484

@@ -88,7 +88,7 @@ private bool IsValidSwipe(ref ActiveGesture gesture)
8888
private bool IsValidTap(ref ActiveGesture gesture)
8989
{
9090
return gesture.TravelDistance <= maxTapDrift &&
91-
(gesture.StartTime - gesture.EndTime) <= maxTapDuration;
91+
(gesture.EndTime - gesture.StartTime) <= maxTapDuration;
9292
}
9393

9494
private void OnPressed(PointerInput input, double time)

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ however, it has to be formatted properly to pass verification tests.
1616
- Several bugs with layout overrides registered with (`InputSystem.RegisterLayoutOverrides`).
1717
* In `1.0-preview`, layout overrides could lead to corruption of the layout state and would also not be handled correctly by the various editor UIs.
1818
- Selecting a layout in the input debugger no longer selects its first child item, too.
19+
- Fixed tap/swipe gesture detection in touch samples.
1920

2021
### Actions
2122

0 commit comments

Comments
 (0)