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').Migrations
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'
| 'yellow'
>
fill: import('@tldraw/editor').EnumStyleProp<
'none' | 'pattern' | 'semi' | 'solid'
>
dash: import('@tldraw/editor').EnumStyleProp<
'dashed' | 'dotted' | 'draw' | 'solid'
>
size: import('@tldraw/editor').EnumStyleProp<'l' | 'm' | 's' | 'xl'>
segments: import('@tldraw/editor').ArrayOfValidator<{
type: 'free' | 'straight'
points: import('@tldraw/editor').VecModel[]
}>
isComplete: import('@tldraw/editor').Validator<boolean>
isClosed: import('@tldraw/editor').Validator<boolean>
isPen: import('@tldraw/editor').Validator<boolean>
}
References
EnumStyleProp, ArrayOfValidator, VecModel, Validator
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): SVGGElement
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
SVGGElement
References