Public function

Signature
function getPerfectDashProps(
  totalLength: number,
  strokeWidth: number,
  opts?: Partial<{
    closed: boolean
    end: 'none' | 'outset' | 'skip'
    lengthRatio: number
    snap: number
    start: 'none' | 'outset' | 'skip'
    style: TLDefaultDashStyle
  }>
): {
  strokeDasharray: string
  strokeDashoffset: string
}
Parameters
NameDescription

totalLength

number

strokeWidth

number

opts

Partial<{
  closed: boolean
  end: 'none' | 'outset' | 'skip'
  lengthRatio: number
  snap: number
  start: 'none' | 'outset' | 'skip'
  style: TLDefaultDashStyle
}>
Returns
{
  strokeDasharray: string
  strokeDashoffset: string
}
References

TLDefaultDashStyle

Source

packages/tldraw/src/lib/shapes/shared/getPerfectDashProps.ts

getOccludedChildrengetSvgAsImage