class

Egui::KineticScroller

Inherits Reference < Object

Kinetic scrolling state machine (one per scrollable axis, driven by a History of the offset): while direct input arrives (wheel, scrollbar thumb) the offset moves immediately and the history estimates the release velocity; once input stops, the offset keeps gliding by that velocity with exponential decay (half-life HALF_LIFE seconds), stopping dead at the content edges.

Stateless across frames: the owner persists offset/velocity (IdTypeMap cells) and the History (Memory#scroll_history) and rebuilds the scroller each frame.

Constants

HALF_LIFE = 0.12
MAX_VELOCITY = 1500.0
STOP_VELOCITY = 15.0

Constructors

new(offset : Float64, velocity : Float64, history : History)
Source

Instance methods

glide(dt : Float64, max_offset : Float64, ctx : Context) : Nil

No input this frame: glide by the latched velocity, decaying it. request_repaint keeps frames coming while the glide lives.

Source
input(delta : Float64, time : Float64, max_offset : Float64) : Nil

Direct input this frame (wheel notch, scrollbar drag): apply now, latch a sample for the release-velocity estimate. A lone sample (one isolated notch) estimates nothing — no fling.

Source
offset
Source
takeover

The scrollbar thumb takes over: direct control, no inertia.

Source
velocity
Source