Public function

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

shape

TLBaseBoxShape

info

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

opts

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

TLBaseBoxShape, VecModel, TLResizeHandle, TLResizeMode, Box

Source

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

RequiredKeysResizeBoxOptions