Method Cairo.Context()->set_dash()


Method set_dash

void set_dash(array(float|int) dashes, float|int offset)

Description

Sets the dash pattern to be used by stroke(). A dash pattern is specified by dashes, an array of positive values. Each value provides the length of alternate "on" and "off" portions of the stroke. The offset specifies an offset into the pattern at which the stroke begins.

Each "on" segment will have caps applied as if the segment were a separate sub-path. In particular, it is valid to use an "on" length of 0.0 with LINE_CAP_ROUND or LINE_CAP_SQUARE in order to distributed dots or squares along a path.

Note

The length values are in user-space units as evaluated at the time of stroking. This is not necessarily the same as the user space at the time of set_dash().

If dashes is empty dashing is disabled.

If dashes contains a single value a symmetric pattern is assumed with alternating on and off portions of the size specified by the value.

Parameter dashes

an array specifying alternate lengths of on and off stroke portions

Parameter offset

an offset into the dash pattern at which the stroke should start