Stroke.setDash

Sets the dash pattern to use by this stroke.

A dash pattern is specified by an array of alternating non-negative values. Each value provides the length of alternate "on" and "off" portions of the stroke.

Each "on" segment will have caps applied as if the segment were a separate contour. In particular, it is valid to use an "on" length of 0 with gsk.types.LineCap.Round or gsk.types.LineCap.Square to draw dots or squares along a path.

If n_dash is 0, if all elements in dash are 0, or if there are negative values in dash, then dashing is disabled.

If n_dash is 1, an alternating "on" and "off" pattern with the single dash length provided is assumed.

If n_dash is uneven, the dash array will be used with the first element in dash defining an "on" or "off" in alternating passes through the array.

You can specify a starting offset into the dash with gsk.stroke.Stroke.setDashOffset.

class Stroke
void
setDash
(
float[] dash = null
)

Parameters

dash float[]

the array of dashes