@mocanvas/editor · function

getSelectedShapeAtPoint

declare function getSelectedShapeAtPoint(editor: Editor, point: VecLike): UnknownShape | undefined

The topmost SELECTED shape under a page point, or undefined.

The test a pointer-down does before starting a drag: pressing inside the existing selection continues it, pressing outside starts a new one. Asking getShapeAtPoint instead would pick up an unselected shape drawn above the selection and get that decision backwards.

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.