diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 06:41:28 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | ff252345bc3e1edc1aee93ca826f294bf9a7874f (patch) | |
| tree | 61c8d8ff2a13e7ceca77d439eeff8edc41fa644c /src/pardes.zig | |
| parent | 09ec515c5e94de741104038cd61f18b2b997e78c (diff) | |
| download | pardes-ff252345bc3e1edc1aee93ca826f294bf9a7874f.tar.gz pardes-ff252345bc3e1edc1aee93ca826f294bf9a7874f.zip | |
G6: a wheel's notch scrolls the core at once and the picture glides after it
A mouse wheel's notch (SDL's whole-number step, notchOf) scrolls the core
by its lines at once, so keys and clicks act where the text is, and the
picture follows on the Motion flavour's spring at half again its pace,
critically damped whatever the flavour (text never passes its mark),
carried from its current speed (animation.Spring.carry), so notches in a
row flow on. How far the rows moved is measured on the next frame against
the last (Glide.measure: a wrapped line's rows, a terminal's output, with a
couple of rows' slack for the cursor's line and its number); the rows that
left are kept, nearest first, and drawn in the gap the lag opens; the lag
is never more than the body's height. A touchpad's fractions move the
picture under the finger as before; `Motion off` lands a notch at once;
a PDF page scrolls as before.
The glide runs on the core's continuous path: Pardes.shell_continuous
keeps frames coming every loop while it moves and carries a virtual clock
with it; idle, nothing. The test feed takes wheel events
(ESC]777;mouse;wheel;<amount>;<x>;<y>BEL).
Tests: notch vs fraction; a carried spring keeps its speed and never
passes its mark; a notch over two-row lines lags two rows, keeps the rows
that left, settles frame by frame and leaves the continuous path, and
lands at once with Motion off. Gates as G5. Feel review:
.scratch/render/scroll/glide-{smooth,crisp,bouncy,off}{,-quarter}.mp4 and
strips (a notch down, three, then two up).
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index 54fe2df0..bbd8e7cd 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -4294,6 +4294,10 @@ pub const Pardes = struct { /// the pane and view origin it was last aimed in, and the last key or /// click, which a blink holds for. cursor_glide: animation.CursorGlide = .{}, + /// A pixel shell's own render-time motion is under way (its smooth + /// scroll, G6): the core then keeps the continuous path running, so the + /// shell draws every loop and a virtual clock moves on, as for a lift. + shell_continuous: bool = false, cursor_view: struct { serial: u32 = 0, line: i64 = 0 } = .{}, input_ns: u64 = 0, animate_theme_changes: bool = false, @@ -6527,7 +6531,7 @@ pub const Pardes = struct { /// is for the stepped animations, which count frames of `frame_ns`. pub fn continuous(p: *const Pardes) bool { for (p.lifts) |spring| if (!spring.settled) return true; - return p.cursor_glide.moving(); + return p.cursor_glide.moving() or p.shell_continuous; } /// For shells that only need a yes or no: macOS and the board, which |
