ImageShapeUtil
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
onDoubleClick
Public property
Signature
onDoubleClick: (shape: TLImageShape) => void
References
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
Name | Description |
---|---|
|
|
Returns
import('react/jsx-runtime').JSX.Element
References
getDefaultProps()
Public method
Signature
getDefaultProps(): TLImageShape['props']
References
indicator()
Public method
Signature
indicator(shape: TLImageShape): import('react/jsx-runtime').JSX.Element | null
Parameters
Name | Description |
---|---|
|
|
Returns
import('react/jsx-runtime').JSX.Element | null
References
toSvg()
Public method
Signature
toSvg(shape: TLImageShape): Promise<SVGGElement>
Parameters
Name | Description |
---|---|
|
|
Returns
Promise<SVGGElement>
References