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§
- Smooth
Scroll - A 1-D smooth scroll axis.
offsetis the current (fractional) pixel offset;targetis where we’re easing toward;velocitycarries momentum after a flick. Advance withadvance(injected dt) — never reads wall-clock time.
Functions§
- smooth_
scroll_ area - Smooth-scroll wrapper around an
egui::ScrollArea(SCRL-3): render the area at the eased offset(s) carried by the caller’sSmoothScrollstate, run the content, thenfollowegui’s resolved offset so the position glides instead of snapping. Keeps egui’s virtualization, scrollbars and wheel/flick handling untouched — it only low-passes the displayed offset.