RoundedRect
Object Hierarchy:
Description:
[ CCode ( has_type_id = false ) ]
public struct RoundedRect
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 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).
Content:
Methods:
- public bool contains_point (Point point)
Checks if the given point is inside the rounded rectangle.
- public bool contains_rect (Rect rect)
Checks if the given rectangle is contained inside the rounded
rectangle.
- public unowned RoundedRect? init (Rect bounds, Size top_left, Size top_right, Size bottom_right, Size bottom_left)
Initializes a rounded rectangle with the given values.
- public unowned RoundedRect? init_copy (RoundedRect src)
Initializes a rounded rectangle with a copy.
- public unowned RoundedRect? init_from_rect (Rect bounds, float radius)
Initializes a rounded rectangle to the given bounds and sets the
radius of all four corners equally.
- public bool intersects_rect (Rect rect)
Checks if part a rectangle is contained inside the rounded rectangle.
- public bool is_rectilinear ()
Checks if all corners of a rounded rectangle are right angles and the
rectangle covers all of its bounds.
- public unowned RoundedRect? normalize ()
Normalizes a rounded rectangle.
- public unowned RoundedRect? offset (float dx, float dy)
Offsets the rounded rectangle's origin by dx and dy
.
- public unowned RoundedRect? shrink (float top, float right, float bottom, float left)
Shrinks (or grows) a rounded rectangle by moving the 4 sides according
to the offsets given.
Fields: