Table of contents

Public class

Signature
class ImageShapeUtil extends BaseBoxShapeUtil<TLImageShape> {}
References

BaseBoxShapeUtil, TLImageShape

Source

packages/tldraw/src/lib/shapes/image/ImageShapeUtil.tsx


Properties

canCrop

Public property

Signature
canCrop: () => boolean

isAspectRatioLocked

Public property

Signature
isAspectRatioLocked: () => boolean

migrations

Public static property

Signature
static migrations: import('@tldraw/editor').Migrations
References

Migrations


onDoubleClick

Public property

Signature
onDoubleClick: (shape: TLImageShape) => void
References

TLImageShape


onDoubleClickEdge

Public property

Signature
onDoubleClickEdge: TLOnDoubleClickHandler<TLImageShape>
References

TLOnDoubleClickHandler, TLImageShape


props

Public static property

Signature
static props: {
  w: import('@tldraw/editor').Validator<number>
  h: import('@tldraw/editor').Validator<number>
  playing: import('@tldraw/editor').Validator<boolean>
  url: import('@tldraw/editor').Validator<string>
  assetId: import('@tldraw/editor').Validator<
    import('@tldraw/editor').TLAssetId | null
  >
  crop: import('@tldraw/editor').Validator<{
    topLeft: import('@tldraw/editor').VecModel
    bottomRight: import('@tldraw/editor').VecModel
  } | null>
}
References

Validator, TLAssetId, VecModel


type

Public static property

Signature
static type: 'image'

Methods

component()

Public method

Signature
component(shape: TLImageShape): import('react/jsx-runtime').JSX.Element
Parameters
NameDescription

shape

TLImageShape
Returns
import('react/jsx-runtime').JSX.Element
References

TLImageShape


getDefaultProps()

Public method

Signature
getDefaultProps(): TLImageShape['props']
References

TLImageShape


indicator()

Public method

Signature
indicator(shape: TLImageShape): import('react/jsx-runtime').JSX.Element | null
Parameters
NameDescription

shape

TLImageShape
Returns
import('react/jsx-runtime').JSX.Element | null
References

TLImageShape


toSvg()

Public method

Signature
toSvg(shape: TLImageShape): Promise<SVGGElement>
Parameters
NameDescription

shape

TLImageShape
Returns
Promise<SVGGElement>
References

TLImageShape


IconInput