TLGetShapeAtPointOptions

See source code
Table of contents

Options to Editor.getShapeAtPoint.

interface TLGetShapeAtPointOptions {}

Properties

hitFrameInside

optional

Whether to register hits on the inside of frame shapes. todo: rename this to hitInsideFrames

hitFrameInside?: boolean

hitInside

optional

Whether to register hits inside of shapes (beyond the margin), such as the inside of a solid shape.

hitInside?: boolean

hitLabels

optional

Whether to register hits on labels.

hitLabels?: boolean

hitLocked

optional

Whether to register hits on locked shapes.

hitLocked?: boolean

margin

optional

The margin to apply to the shape. If a number, it will be applied to both the inside and outside of the shape. If an array, the first element will be applied to the inside of the shape, and the second element will be applied to the outside.

margin?: [number, number] | number

Example

// Get the shape at the center of the screen
const shape = editor.getShapeAtProps({
  margin: 10,
})

// Get the shape at the center of the screen with a 10px inner margin and a 5px outer margin
const shape = editor.getShapeAtProps({
  margin: [10, 5],
})

renderingOnly

optional

Whether to only return hits on shapes that are currently being rendered. todo: rename this to hitCulled or hitNotRendering

renderingOnly?: boolean

Methods

filter

optional

A filter function to apply to the shapes.

Parameters

NameDescription

shape

Returns

boolean

Prev
TLGeometryOpts
Next
TLGridProps