Skip to main content

Module edge_autoscroll

Module edge_autoscroll 

Expand description

Edge autoscroll: a drag resting in the band along a viewport’s edge scrolls the viewport that way, from nothing at the band’s inner side to full speed at the edge and beyond it. Window strips, reorderable lists and trees, block drags and text selections all scroll by this one model.

Structs§

EdgeAutoscroll
The frame clock of one edge autoscroll: the first frame in a band only starts it, each later one scrolls by the time since the last, and leaving the band stops it.

Functions§

distance
How far velocity scrolls over a frame of elapsed; a stalled frame counts as at most EDGE_AUTOSCROLL_MAX_STEP, so it does not fling.
velocity
How fast, in px/s, a viewport spanning start..end on one axis scrolls under a drag at pointer on that axis: negative toward start, 0 outside the edge bands or when the viewport is too small to hold both.
velocity_past_press
velocity for a drag that was pressed at press, over a band band deep: it scrolls toward an edge only once the pointer has gone further that way than where it was pressed. A press already inside the band does not scroll by itself, and a drag back inward never scrolls outward.