DrawShapeUtil
Table of contents
Public class
Signature
class DrawShapeUtil extends ShapeUtil<TLDrawShape> {}
References
Source
packages/tldraw/src/lib/shapes/draw/DrawShapeUtil.tsx
Properties
hideResizeHandles
Public property
Signature
hideResizeHandles: (shape: TLDrawShape) => boolean
References
hideRotateHandle
Public property
Signature
hideRotateHandle: (shape: TLDrawShape) => boolean
References
hideSelectionBoundsFg
Public property
Signature
hideSelectionBoundsFg: (shape: TLDrawShape) => boolean
References
migrations
Public static property
Signature
static migrations: import('@tldraw/editor').TLShapePropsMigrations
References
onResize
Public property
Signature
onResize: TLOnResizeHandler<TLDrawShape>
References
TLOnResizeHandler, TLDrawShape
props
Public static property
Signature
static props: {
color: import('@tldraw/editor').EnumStyleProp<
| 'black'
| 'blue'
| 'green'
| 'grey'
| 'light-blue'
| 'light-green'
| 'light-red'
| 'light-violet'
| 'orange'
| 'red'
| 'violet'
| 'white'
| 'yellow'
>
dash: import('@tldraw/editor').EnumStyleProp<
'dashed' | 'dotted' | 'draw' | 'solid'
>
fill: import('@tldraw/editor').EnumStyleProp<
'none' | 'pattern' | 'semi' | 'solid'
>
isClosed: import('@tldraw/editor').Validator<boolean>
isComplete: import('@tldraw/editor').Validator<boolean>
isPen: import('@tldraw/editor').Validator<boolean>
segments: import('@tldraw/editor').ArrayOfValidator<{
points: import('@tldraw/editor').VecModel[]
type: 'free' | 'straight'
}>
size: import('@tldraw/editor').EnumStyleProp<'l' | 'm' | 's' | 'xl'>
}
References
EnumStyleProp, Validator, ArrayOfValidator, VecModel
type
Public static property
Signature
static type: 'draw'
Methods
component()
Public method
Signature
component(shape: TLDrawShape): import('react/jsx-runtime').JSX.Element
Parameters
Name | Description |
---|---|
|
|
Returns
import('react/jsx-runtime').JSX.Element
References
expandSelectionOutlinePx()
Public method
Signature
expandSelectionOutlinePx(shape: TLDrawShape): number
Parameters
Name | Description |
---|---|
|
|
Returns
number
References
getCanvasSvgDefs()
Public method
Signature
getCanvasSvgDefs(): TLShapeUtilCanvasSvgDef[]
References
getDefaultProps()
Public method
Signature
getDefaultProps(): TLDrawShape['props']
References
getGeometry()
Public method
Signature
getGeometry(shape: TLDrawShape): Circle2d | Polyline2d
Parameters
Name | Description |
---|---|
|
|
Returns
Circle2d | Polyline2d
References
TLDrawShape, Circle2d, Polyline2d
indicator()
Public method
Signature
indicator(shape: TLDrawShape): import('react/jsx-runtime').JSX.Element
Parameters
Name | Description |
---|---|
|
|
Returns
import('react/jsx-runtime').JSX.Element
References
toSvg()
Public method
Signature
toSvg(
shape: TLDrawShape,
ctx: SvgExportContext
): import('react/jsx-runtime').JSX.Element
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
import('react/jsx-runtime').JSX.Element
References