Canvasity.setLineDash

Set or clear the line dash pattern.

Takes an array with entries alternately giving the lengths of dash and gap segments. All must be non-negative; if any are not, this does nothing. These will be used to draw with dashed lines when stroking, with each subpath starting at the length along the dash pattern indicated by the line dash offset. Initially these lengths are measured in pixels, though the current transform at the time of drawing can affect this. The count must be non-negative. If it is odd, the array will be appended to itself to make an even count. If it is zero, or the pointer is null, the dash pattern will be cleared and strokes will be drawn as solid lines. The array is copied and it is safe to change or destroy it after this call. Defaults to solid lines.

Meta