Class (GI Struct)

Gsk-4.0GskStrokeSince 4.14

Collects the parameters that are needed when stroking a path.

4.14

Index

Constructors

Properties

$gtype: GType<Stroke>

Methods

  • Gets the dash array in use.

    Returns number[]

    the dash array or NULL if the dash array is empty

  • Sets the dash pattern to use.

    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.LineCap.ROUND or Gsk.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.set_dash_offset.

    Parameters

    • Optionaldash: number[]

      the array of dashes

    Returns void

  • Sets the offset into the dash pattern where dashing should begin.

    This is an offset into the length of the path, not an index into the array values of the dash array.

    See Gsk.Stroke.set_dash for more details on dashing.

    Parameters

    • offset: number

      offset into the dash pattern

    Returns void

  • Sets the line width to be used when stroking.

    The line width must be >= 0.

    Parameters

    • line_width: number

      width of the line in pixels

    Returns void

  • Sets the miter limit to be used when stroking.

    The miter limit is the distance from the corner where sharp turns of joins get cut off.

    The limit is specfied in units of line width and must be non-negative.

    For joins of type Gsk.LineJoin.MITER that exceed the miter limit, the join gets rendered as if it was of type Gsk.LineJoin.BEVEL.

    Parameters

    • limit: number

      the miter limit

    Returns void

  • Checks if two strokes are identical.

    Parameters

    • Optionalstroke1: any

      the first stroke

    • Optionalstroke2: any

      the second stroke

    Returns boolean