the bounds of the rectangle
the size of the 4 rounded corners
Initializes the given GskRoundedRect
with the given values.
This function will implicitly normalize the GskRoundedRect
before returning.
a graphene_rect_t
describing the bounds
the rounding radius of the top left corner
the rounding radius of the top right corner
the rounding radius of the bottom right corner
the rounding radius of the bottom left corner
Initializes self
using the given src
rectangle.
This function will not normalize the GskRoundedRect
,
so make sure the source is normalized.
a GskRoundedRect
Initializes self
to the given bounds
and sets the radius
of all four corners to radius
.
Checks if all corners of self
are right angles and the
rectangle covers all of its bounds.
This information can be used to decide if [ctorGsk
.ClipNode.new]
or [ctorGsk
.RoundedClipNode.new] should be called.
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.
Offsets the bound's origin by dx
and dy
.
The size and corners of the rectangle are unchanged.
the horizontal offset
the vertical offset
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
.
How far to move the top side downwards
How far to move the right side to the left
How far to move the bottom side upwards
How far to move the left side to the right
A 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 aGskRoundedRect
will always return a normalized one.The algorithm used for normalizing corner sizes is described in the CSS specification.