@docx-editor.dev/core/utils/autoScroll

Functions (1)

computeAutoScrollDeltafunctionSource ↗

Vertical scroll delta (px/frame) for a pointer at mouseY over a container whose viewport spans rect.top..rect.bottom. Negative scrolls up, positive down, 0 when the pointer is outside both edge zones. Speed ramps linearly from 0 at the edge-zone boundary to AUTO_SCROLL_MAX_SPEED at the edge.

declare function computeAutoScrollDelta(rect: {
    top: number;
    bottom: number;
}, mouseY: number): number;

Variables (2)

AUTO_SCROLL_EDGE_ZONEconstSource ↗

Pixel distance from the container edge where auto-scroll activates.

AUTO_SCROLL_EDGE_ZONE = 40

AUTO_SCROLL_MAX_SPEEDconstSource ↗

Maximum scroll speed in pixels per frame (~60fps).

AUTO_SCROLL_MAX_SPEED = 12

On this page