set_dash


Description:

public void set_dash (float[]? dash)

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_LINE_CAP_ROUND` or `GSK_LINE_CAP_SQUARE` to draw dots or squares along a path.

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

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

If dash.length 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 [method@Gsk.Stroke.set_dash_offset].

Parameters:

this

a `GskStroke`

dash

the array of dashes

n_dash

number of elements in dash