@mocanvas/editor · class

EdgeScrollManager

declare class EdgeScrollManager extends EditorManager

This one ships without a description. The signature above is read from the package, and the guides cover the area it belongs to.


Methods · 5

constructor(editor: Editor)
getIsEnabled(): boolean

Whether a gesture has asked for edge scrolling.

start(): void

Turn edge scrolling on for the duration of a gesture. Tools call this when a drag that can move things starts, and stop when it ends.

stop(): void

Turn edge scrolling off and forget how long the pointer has been at an edge.

updateEdgeScrolling(elapsed: number): Vec

Advance edge scrolling by elapsed milliseconds and pan if it is due.

Returns the screen-space offset it applied, which is {x: 0, y: 0} when the pointer is not at an edge, the delay has not elapsed, or the camera is locked — so a tool can use the return value to move the shape it is dragging by the same amount and keep it under the cursor.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.