Public function

Signature
function resizeBox(
  shape: TLBaseBoxShape,
  info: {
    handle: TLResizeHandle
    initialBounds: Box
    initialShape: TLBaseBoxShape
    mode: TLResizeMode
    newPoint: VecModel
    scaleX: number
    scaleY: number
  },
  opts?: Partial<{
    maxHeight: number
    maxWidth: number
    minHeight: number
    minWidth: number
  }>
): {
  props: {
    h: number
    w: number
  }
  x: number
  y: number
}
Parameters
NameDescription

shape

TLBaseBoxShape

info

{
  handle: TLResizeHandle
  initialBounds: Box
  initialShape: TLBaseBoxShape
  mode: TLResizeMode
  newPoint: VecModel
  scaleX: number
  scaleY: number
}

opts

Partial<{
  maxHeight: number
  maxWidth: number
  minHeight: number
  minWidth: number
}>
Returns
{
  props: {
    h: number
    w: number
  }
  x: number
  y: number
}
References

TLBaseBoxShape, TLResizeHandle, Box, TLResizeMode, VecModel

Source

packages/editor/src/lib/editor/shapes/shared/resizeBox.ts

RequiredKeysResizeBoxOptions