diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-28 17:56:30 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-28 21:05:39 -0300 |
| commit | f8fb785c9572855943713181d738b72ea494b7d5 (patch) | |
| tree | 5a650fb25c0bfde3d14fd11cf49ba204d61ca752 /src/animation.zig | |
| parent | 96f840a055651b88eb1191772bc4b10fcbbb60ce (diff) | |
| download | pardes-f8fb785c9572855943713181d738b72ea494b7d5.tar.gz pardes-f8fb785c9572855943713181d738b72ea494b7d5.zip | |
caret: a wheel's scroll moves the caret with its line, the text's own glide, no spring of its own chasing it (the dance): its springs land on its cell (CursorGlide.How .rigid gone) and the pixel shell draws it at its cell less the glide's offset while its line rides (caretRide, Glide.caret_rides), clipped as the text is; a page that keeps its row leaves it still as before; tests: the springs land, the caret rides exactly with its line
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/animation.zig')
| -rw-r--r-- | src/animation.zig | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/animation.zig b/src/animation.zig index 764aa0b3..37d74813 100644 --- a/src/animation.zig +++ b/src/animation.zig @@ -1125,9 +1125,9 @@ pub const CursorGlide = struct { /// Heads for `box` at `now_ns`. /// How a new mark is gone to: eased (a step, or a jump's smear and - /// bow), landed at once, or moved whole at a scroll's pace (the text - /// moved under it, not the caret). - pub const How = enum { ease, land, rigid }; + /// bow), or landed at once (a scroll: the text moved under it, not the + /// caret; a shell carries it with the text's own glide). + pub const How = enum { ease, land }; pub fn aim(glide: *CursorGlide, box: Box, now_ns: u64, motion: Motion, how: How) void { // The same mark: nothing to do, unless a snap lands a glide under way. @@ -1152,11 +1152,9 @@ pub const CursorGlide = struct { // Leading: the corner ahead of the move, on the side it goes. const ahead = (point[0] - to_c[0]) * dx + (point[1] - to_c[1]) * dy; var own = motion; - own.omega *= if (how == .rigid) 1.5 else if (jump) pace * (if (ahead > 0) 1 else motion.follow) else pace * step_pace; - // A step neither winds up nor overshoots: it is a caret moving; - // nor a whole move with the text (rigid: at the view's pace, - // Glide's 1.5x, its corners together). - if (!jump or how == .rigid) { + own.omega *= if (jump) pace * (if (ahead > 0) 1 else motion.follow) else pace * step_pace; + // A step neither winds up nor overshoots: it is a caret moving. + if (!jump) { own.zeta = 1; own.anticipate = 0; } |
