diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-16 12:18:01 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-09-16 12:18:10 -0300 |
| commit | e476e38d8b8ace8014c2d2e88e2a082e0147b77b (patch) | |
| tree | 90955d94035e689eb3c112d3b635be7b00036dff /src/allocators.zig | |
| parent | 921cddfee4d7de1b0acb98b635b86cc6f1d7a5f5 (diff) | |
| download | pardes-e476e38d8b8ace8014c2d2e88e2a082e0147b77b.tar.gz pardes-e476e38d8b8ace8014c2d2e88e2a082e0147b77b.zip | |
Give macOS scrolling momentum
A swipe that was still moving when the fingers lifted stopped dead. The dial
next to it has thrown properly since pardes_rotate_end, and this is that same
curve on the scroll accumulator: velocity sampled between events off the
monotonic clock, weighted toward the newest sample because a flick is decided
by how the hand was moving when it left, and a fling that ramps up from zero
at the floor rather than switching on at it.
A coast stops at the end of a document rather than spinning its remaining
velocity against the edge, which is why spendScroll now reports whether the
pane moved and why paneAt is public. Only a step that delivered a press can
report an edge — the many steps between two rows cross nothing.
Nothing suppresses AppKit's own momentum, and nothing needs to: its momentum
events are ordinary pardes_scroll calls, every one of which cancels the coast
before spending its travel, so on a real trackpad the system takes the gesture
over about a frame after the lift and the tail it ends on is below the floor.
This is the path for devices AppKit does not fling for — and the only one a
script can reach, since NSEvent phases have no public constructor.
momentum.snap asserts both halves, which is why it needs the long scrollback:
a flick with no document left proves nothing. A slow swipe is byte-identical
after the release; a hard one coasts twenty-four rows further on its own, and
a finger back on the pad stops it there.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Diffstat (limited to 'src/allocators.zig')
0 files changed, 0 insertions, 0 deletions
