package ocgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054
doc/ocgtk.gsk/Ocgtk_gsk/Gsk/Wrappers/Path/index.html
Module Wrappers.Path
type t = [ `path ] Gobject.objval to_string : t -> stringConverts the path into a string that is suitable for printing.
You can use this function in a debugger to get a quick overview of the path.
This is a wrapper around method@Gsk.Path.print, see that function for details.
val to_cairo : t -> Ocgtk_cairo.Cairo.Wrappers.Context.t -> unitAppends the given @path to the given cairo context for drawing with Cairo.
This may cause some suboptimal conversions to be performed as Cairo does not support all features of `GskPath`.
This function does not clear the existing Cairo path. Call cairo_new_path() if you want this.
val is_empty : t -> boolChecks if the path is empty, i.e. contains no lines or curves.
val is_closed : t -> boolReturns if the path represents a single closed contour.
val in_fill :
t ->
Ocgtk_graphene.Graphene.Wrappers.Point.t ->
Gsk_enums.fillrule ->
boolReturns whether the given point is inside the area that would be affected if the path was filled according to @fill_rule.
Note that this function assumes that filling a contour implicitly closes it.
val get_stroke_bounds :
t ->
[ `stroke ] Gobject.obj ->
bool * Ocgtk_graphene.Graphene.Wrappers.Rect.tComputes the bounds for stroking the given path with the parameters in @stroke.
The returned bounds may be larger than necessary, because this function aims to be fast, not accurate. The bounds are guaranteed to contain the area affected by the stroke, including protrusions like miters.
val get_start_point : t -> bool * [ `path_point ] Gobject.objGets the start point of the path.
An empty path has no points, so `FALSE` is returned in this case.
val get_end_point : t -> bool * [ `path_point ] Gobject.objGets the end point of the path.
An empty path has no points, so `FALSE` is returned in this case.
val get_closest_point :
t ->
Ocgtk_graphene.Graphene.Wrappers.Point.t ->
float ->
bool * [ `path_point ] Gobject.obj * floatComputes the closest point on the path to the given point and sets the @result to it.
If there is no point closer than the given threshold, `FALSE` is returned.
val get_bounds : t -> bool * Ocgtk_graphene.Graphene.Wrappers.Rect.tComputes the bounds of the given path.
The returned bounds may be larger than necessary, because this function aims to be fast, not accurate. The bounds are guaranteed to contain the path.
It is possible that the returned rectangle has 0 width and/or height. This can happen when the path only describes a point or an axis-aligned line.
If the path is empty, `FALSE` is returned and @bounds are set to graphene_rect_zero(). This is different from the case where the path is a single point at the origin, where the @bounds will also be set to the zero rectangle but `TRUE` will be returned.