@mocanvas/editor · interface

HitTestOptions

interface HitTestOptions

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


Properties · 6

filter?: (shape: UnknownShape) => boolean
hitFrameInside?: boolean
hitInside?: boolean
hitLocked?: boolean
margin?: number
renderingOnly?: boolean

Only consider shapes the viewport is currently rendering.

A large page culls most of its shapes, and for a pointer gesture "off screen" and "not hit" are the same answer — so this makes the hit test cost proportional to what is visible rather than to the document.

Off by default: a programmatic query ("what is at this page point?") is usually asked about the document, not about the viewport, and an answer that changed with the scroll position would be surprising.

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.