New

docx-editor 1.x has shipped. Vue support, i18n, agents. Read the migration guide →

API Referencev1.3.2

@eigenpal/docx-editor-core/utils/autoScroll

Functions(1)

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)

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

AUTO_SCROLL_EDGE_ZONE = 40

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

AUTO_SCROLL_MAX_SPEED = 12