Table of contents

Public class

Signature
class LineShapeUtil extends ShapeUtil<TLLineShape> {}
References

ShapeUtil, TLLineShape

Source

packages/tldraw/src/lib/shapes/line/LineShapeUtil.tsx


Properties

hideResizeHandles

Public property

Signature
hideResizeHandles: () => boolean

hideRotateHandle

Public property

Signature
hideRotateHandle: () => boolean

hideSelectionBoundsBg

Public property

Signature
hideSelectionBoundsBg: () => boolean

hideSelectionBoundsFg

Public property

Signature
hideSelectionBoundsFg: () => boolean

migrations

Public static property

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

Migrations


onHandleDrag

Public property

Signature
onHandleDrag: TLOnHandleDragHandler<TLLineShape>
References

TLOnHandleDragHandler, TLLineShape


onResize

Public property

Signature
onResize: TLOnResizeHandler<TLLineShape>
References

TLOnResizeHandler, TLLineShape


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'
  >
  dash: import('@tldraw/editor').EnumStyleProp<
    'dashed' | 'dotted' | 'draw' | 'solid'
  >
  size: import('@tldraw/editor').EnumStyleProp<'l' | 'm' | 's' | 'xl'>
  spline: import('@tldraw/editor').EnumStyleProp<'cubic' | 'line'>
  handles: import('@tldraw/editor').DictValidator<string, TLHandle>
}
References

EnumStyleProp, DictValidator, TLHandle


type

Public static property

Signature
static type: 'line'

Methods

component()

Public method

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

shape

TLLineShape
Returns
import('react/jsx-runtime').JSX.Element | undefined
References

TLLineShape


getDefaultProps()

Public method

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

TLLineShape


getGeometry()

Public method

Signature
getGeometry(shape: TLLineShape): CubicSpline2d | Polyline2d
Parameters
NameDescription

shape

TLLineShape
Returns
CubicSpline2d | Polyline2d
References

TLLineShape, CubicSpline2d, Polyline2d


getHandles()

Public method

Signature
getHandles(shape: TLLineShape): TLHandle[]
Parameters
NameDescription

shape

TLLineShape
Returns
TLHandle[]
References

TLLineShape, TLHandle


getOutlineSegments()

Public method

Signature
getOutlineSegments(shape: TLLineShape): Vec[][]
Parameters
NameDescription

shape

TLLineShape
Returns
Vec[][]
References

TLLineShape, Vec


indicator()

Public method

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

shape

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

TLLineShape


toSvg()

Public method

Signature
toSvg(shape: TLLineShape): SVGGElement
Parameters
NameDescription

shape

TLLineShape
Returns
SVGGElement
References

TLLineShape


LineShapeToolmenuCustom