• Jonah Williams's avatar
    [framework] make hit slop based on device pointer kind for drag/pan/scale gestures (#64267) · 29898812
    Jonah Williams authored
    Currently the framework uses fairly large "hit slop" values to disambiguate taps from drags/pans. This makes sense on touch devices where the interaction is not very precise, on mice however it can feel as if the UI is lagging. This is immediately noticeable on our infra dashboard, where it takes almost half of a grid square of drag before the actual drag kicks in.
    
    One potential solution is to always use smaller constants depending on whether the interaction is mouse or touch based. The only reasonable choice is to use the pointer device kind and not target platform - same platform can have different input sources. This requires exposing the pointer device kind in a few new places in several of the gesture detectors, and using the enum to compute the correct hit slop from an expanded set of constants.
    
    This almost works, however there are a few places (notably ListViews) which uses the touch hit slop as a default value in scroll physics. It does not seem like it will be easy to disambiguate a user provided scroll physics constant from the default and/or adjust it somehow - this might require significant changes to scroll physics which I have left out of this PR.
    
    This PR does not adjust:
    
    kTouchSlop used in scroll_physics.dart's minFlingDistance
    kTouchSlop used in PrimaryPointerGestureRecognizer/LongPressGestureRecognizer
    29898812
Name
Last commit
Last update
..
arena.dart Loading commit data...
binding.dart Loading commit data...
constants.dart Loading commit data...
converter.dart Loading commit data...
debug.dart Loading commit data...
drag.dart Loading commit data...
drag_details.dart Loading commit data...
eager.dart Loading commit data...
events.dart Loading commit data...
force_press.dart Loading commit data...
hit_test.dart Loading commit data...
long_press.dart Loading commit data...
lsq_solver.dart Loading commit data...
monodrag.dart Loading commit data...
multidrag.dart Loading commit data...
multitap.dart Loading commit data...
pointer_router.dart Loading commit data...
pointer_signal_resolver.dart Loading commit data...
recognizer.dart Loading commit data...
resampler.dart Loading commit data...
scale.dart Loading commit data...
tap.dart Loading commit data...
team.dart Loading commit data...
velocity_tracker.dart Loading commit data...