package ocgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054
doc/ocgtk.gsk/Ocgtk_gsk/Gsk/Wrappers/Rounded_rect/index.html
Module Wrappers.Rounded_rect
type t = [ `rounded_rect ] Gobject.objA rectangular region with rounded corners.
Application code should normalize rectangles using method@Gsk.RoundedRect.normalize; this function will ensure that the bounds of the rectangle are normalized and ensure that the corner values are positive and the corners do not overlap.
All functions taking a `GskRoundedRect` as an argument will internally operate on a normalized copy; all functions returning a `GskRoundedRect` will always return a normalized one.
The algorithm used for normalizing corner sizes is described in the CSS specification(https://drafts.csswg.org/css-backgrounds-3/#border-radius).
Shrinks (or grows) the given rectangle by moving the 4 sides according to the offsets given.
The corner radii will be changed in a way that tries to keep the center of the corner circle intact. This emulates CSS behavior.
This function also works for growing rectangles if you pass negative values for the @top, @right, @bottom or @left.
Offsets the bound's origin by @dx and @dy.
The size and corners of the rectangle are unchanged.
Normalizes the passed rectangle.
This function will ensure that the bounds of the rectangle are normalized and ensure that the corner values are positive and the corners do not overlap.
val is_rectilinear : t -> boolChecks if all corners of @self are right angles and the rectangle covers all of its bounds.
This information can be used to decide if ctor@Gsk.ClipNode.new or ctor@Gsk.RoundedClipNode.new should be called.
val intersects_rect : t -> Ocgtk_graphene.Graphene.Wrappers.Rect.t -> boolChecks if part of the given @rect is contained inside the rounded rectangle.
val init_from_rect : t -> Ocgtk_graphene.Graphene.Wrappers.Rect.t -> float -> tInitializes @self to the given @bounds and sets the radius of all four corners to @radius.
val init :
t ->
Ocgtk_graphene.Graphene.Wrappers.Rect.t ->
Ocgtk_graphene.Graphene.Wrappers.Size.t ->
Ocgtk_graphene.Graphene.Wrappers.Size.t ->
Ocgtk_graphene.Graphene.Wrappers.Size.t ->
Ocgtk_graphene.Graphene.Wrappers.Size.t ->
tInitializes the given `GskRoundedRect` with the given values.
This function will implicitly normalize the `GskRoundedRect` before returning.
val contains_rect : t -> Ocgtk_graphene.Graphene.Wrappers.Rect.t -> boolChecks if the given @rect is contained inside the rounded rectangle.
val contains_point : t -> Ocgtk_graphene.Graphene.Wrappers.Point.t -> boolChecks if the given @point is inside the rounded rectangle.