Name
ccontext:SetDash -- set dash pattern
Synopsis
ccontext:SetDash(offset[, dash1, ...])
Function
Sets the dash pattern to be used by ccontext:Stroke(). A dash pattern is specified by a number of positive dash values starting with dash1. 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 #CAIRO_LINE_CAP_ROUND or #CAIRO_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 ccontext:SetDash().

If you omit the optional dash1 etc. arguments dashing is disabled.

If you pass just a single dash value, a symmetric pattern is assumed with alternating on and off portions of the size specified by the single value in dash1.

If any dash value is negative, or if all values are 0, then the Cairo context will be put into an error state with a status of #CAIRO_STATUS_INVALID_DASH.

Inputs
offset
an offset into the dash pattern at which the stroke should start
dash1
optional: value for first stroke portion (on section)
...
optional: more values specifying alternate lengths of on and off stroke portions

Show TOC