16 Pointer Coalescing. 16 of 95.

16/GESTURE PHYSICS/16 of 95

Pointer Coalescing

Your pointer moved more times than your interface noticed.

Best experienced with a pointer.

The problem

High-frequency pointer hardware produces more samples than pointermove delivers, so ink drawn from the event alone looks sparse and jagged.

The solution

Reads getCoalescedEvents() when the browser returns multiple samples; on mouse/trackpad (≤1 sample) subdivides the segment so the trail stays visibly denser.

Experiment

Play with the values

1200ms
3px

How it works

  • A pointermove can represent more motion than the one event the page receives.
  • The browser coalesces intermediate samples when the main thread is busy.
  • The dispatched event is only the latest point unless the page asks for the rest.
  • getCoalescedEvents() returns the samples that were merged into that event.
  • When the browser returns a single sample, as with many mice, the segment is subdivided so the trail stays dense.
  • Every sample is drawn, so fast strokes do not turn into straight chords.

Seen in

Drawing apps

Ink follows the stylus more faithfully when coalesced samples fill gaps between frames.

Signature pads

Fast signatures stay smooth instead of collapsing into sparse polylines.

Gesture recognition

Shape classifiers see denser trajectories without listening at hardware rate.

Whiteboard tools

Freehand strokes remain continuous under rapid pointer motion.

References