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§
- Edge
Autoscroll - 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
velocityscrolls over a frame ofelapsed; a stalled frame counts as at mostEDGE_AUTOSCROLL_MAX_STEP, so it does not fling. - velocity
- How fast, in px/s, a viewport spanning
start..endon one axis scrolls under a drag atpointeron that axis: negative towardstart,0outside the edge bands or when the viewport is too small to hold both. - velocity_
past_ press velocityfor a drag that was pressed atpress, over a bandbanddeep: 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.