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').TLShapePropsMigrations
References

TLShapePropsMigrations


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'
    | 'white'
    | 'yellow'
  >
  dash: import('@tldraw/editor').EnumStyleProp<
    'dashed' | 'dotted' | 'draw' | 'solid'
  >
  points: import('@tldraw/editor').DictValidator<
    string,
    {
      id: string
      index: import('@tldraw/editor').IndexKey
      x: number
      y: number
    }
  >
  size: import('@tldraw/editor').EnumStyleProp<'l' | 'm' | 's' | 'xl'>
  spline: import('@tldraw/editor').EnumStyleProp<'cubic' | 'line'>
}
References

EnumStyleProp, DictValidator


type

Public static property

Signature
static type: 'line'

Methods

component()

Public method

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

shape

TLLineShape
Returns
import('react/jsx-runtime').JSX.Element
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


getHandleSnapGeometry()

Public method

Signature
getHandleSnapGeometry(shape: TLLineShape): HandleSnapGeometry
Parameters
NameDescription

shape

TLLineShape
Returns
HandleSnapGeometry
References

TLLineShape, HandleSnapGeometry


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): import('react/jsx-runtime').JSX.Element
Parameters
NameDescription

shape

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

TLLineShape


LineShapeToolLineToolbarItem