package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.Stroke

type t = [ `stroke ] Gobject.obj

A `GskStroke` struct collects the parameters that influence the operation of stroking a path.

val new_ : float -> t

Create a new Stroke

val to_cairo : t -> Ocgtk_cairo.Cairo.Wrappers.Context.t -> unit

A helper function that sets the stroke parameters of @cr from the values found in @self.

val set_miter_limit : t -> float -> unit

Sets the limit for the distance from the corner where sharp turns of joins get cut off.

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

For joins of type `GSK_LINE_JOIN_MITER` that exceed the miter limit, the join gets rendered as if it was of type `GSK_LINE_JOIN_BEVEL`.

val set_line_width : t -> float -> unit

Sets the line width to be used when stroking.

The line width must be > 0.

val set_line_join : t -> Gsk_enums.linejoin -> unit

Sets the line join to be used when stroking.

See enum@Gsk.LineJoin for details.

val set_line_cap : t -> Gsk_enums.linecap -> unit

Sets the line cap to be used when stroking.

See enum@Gsk.LineCap for details.

val set_dash_offset : t -> float -> unit

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 method@Gsk.Stroke.set_dash for more details on dashing.

val set_dash : t -> float array option -> Gsize.t -> unit

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 @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 method@Gsk.Stroke.set_dash_offset.

val get_miter_limit : t -> float

Returns the miter limit of a `GskStroke`.

val get_line_width : t -> float

Gets the line width used.

val get_line_join : t -> Gsk_enums.linejoin

Gets the line join used.

See enum@Gsk.LineJoin for details.

val get_line_cap : t -> Gsk_enums.linecap

Gets the line cap used.

See enum@Gsk.LineCap for details.

val get_dash_offset : t -> float

Returns the dash_offset of a `GskStroke`.

val get_dash : t -> float array option * Gsize.t

Gets the dash array in use or `NULL` if dashing is disabled.

val get_type : unit -> Gobject.Type.t