Skip to main content

Module scroll_engine

Module scroll_engine 

Source
Expand description

CygnusEd smooth-scroll engine (§11) — pixel-by-pixel, sub-pixel soft scrolling with momentum/acceleration, à la the Amiga editor’s jerkyless feel. The scroll offset is decoupled from row height (renderers paint at a fractional pixel offset + clip), and the whole thing is deterministic under an injected clock (advance(dt)), so snapshots reproduce exactly (FC-7 / P0-5). Reusable by text, console, and the dataframe grid (SCRL-3).

Structs§

SmoothScroll
A 1-D smooth scroll axis. offset is the current (fractional) pixel offset; target is where we’re easing toward; velocity carries momentum after a flick. Advance with advance (injected dt) — never reads wall-clock time.