@mocanvas/editor · interface

TLGetShapeAtPointOptions

interface TLGetShapeAtPointOptions extends HitTestOptions

Options for Editor.getShapeAtPoint.

The defaults describe "what a person would say is under the pointer": the outline counts, the interior of an unfilled shape does not, locked and hidden shapes are not there at all.


Properties · 6

filter?: (shape: UnknownShape) => boolean

Arbitrary further filtering, applied last.

hitFrameInside?: boolean

Count a hit inside a frame's body rather than only on its edge and heading.

hitInside?: boolean

Count a hit inside an unfilled shape's outline.

Off by default, and that is the interesting case: an unfilled rectangle is a frame around empty space, and clicking the space inside it should select whatever is behind, not the rectangle.

hitLabels?: boolean

Count a hit on the shape's text label even when the shape itself misses.

hitLocked?: boolean

Consider locked shapes. Off by default: a locked shape is not a click target.

margin?: number

Extra tolerance in page units. Defaults to the hit-test margin for the current pointer.

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.