BoundsSnaps

See source code
Table of contents
class BoundsSnaps {}

Constructor

Constructs a new instance of the BoundsSnaps class

Parameters

NameDescription

manager


Properties

editor

readonly
readonly editor: Editor

manager

readonly
readonly manager: SnapManager

Methods

getSnapPoints()

getSnapPoints(shapeId: TLShapeId): BoundsSnapPoint[]

Parameters

NameDescription

shapeId

Returns


snapResizeShapes()

snapResizeShapes({
  initialSelectionPageBounds,
  dragDelta,
  handle: originalHandle,
  isAspectRatioLocked,
  isResizingFromCenter,
}: {
  dragDelta: Vec
  handle: SelectionCorner | SelectionEdge
  initialSelectionPageBounds: Box
  isAspectRatioLocked: boolean
  isResizingFromCenter: boolean
}): SnapData

Parameters

NameDescription

{ initialSelectionPageBounds, dragDelta, handle: originalHandle, isAspectRatioLocked, isResizingFromCenter, }

{
  dragDelta: Vec
  handle: SelectionCorner | SelectionEdge
  initialSelectionPageBounds: Box
  isAspectRatioLocked: boolean
  isResizingFromCenter: boolean
}

Returns


snapTranslateShapes()

snapTranslateShapes({
  lockedAxis,
  initialSelectionPageBounds,
  initialSelectionSnapPoints,
  dragDelta,
}: {
  dragDelta: Vec
  initialSelectionPageBounds: Box
  initialSelectionSnapPoints: BoundsSnapPoint[]
  lockedAxis: 'x' | 'y' | null
}): SnapData

Parameters

NameDescription

{ lockedAxis, initialSelectionPageBounds, initialSelectionSnapPoints, dragDelta, }

{
  dragDelta: Vec
  initialSelectionPageBounds: Box
  initialSelectionSnapPoints: BoundsSnapPoint[]
  lockedAxis: 'x' | 'y' | null
}

Returns


Prev
BindingUtil
Next
Box