Skip to content

@fabwcie/free-drawing / utils/stroke / getDash

Function: getDash() ​

getDash(style, strokeWidth): number[] | undefined

Defined in: packages/free-drawing/src/utils/stroke.ts:10

Dash of a stroke style, proportional to stroke width. Shapes use round line caps: drawn dashes are longer and gaps shorter by stroke width.

Parameters ​

style ​

StrokeStyle

stroke style name

strokeWidth ​

number

stroke width of the shape (shape units)

Returns ​

number[] | undefined

konva dash (lengths of dashes and gaps), undefined for solid strokes