|
| | RoundedRect () |
| | RoundedRect (const GskRoundedRect * rounded_rect) |
| | RoundedRect (const Gdk::Graphene::Rect & bounds, const Gdk::Graphene::Size & top_left, const Gdk::Graphene::Size & top_right, const Gdk::Graphene::Size & bottom_right, const Gdk::Graphene::Size & bottom_left) |
| | RoundedRect (const Gdk::Graphene::Rect & bounds, float radius) |
| | RoundedRect (const RoundedRect & other) noexcept |
| RoundedRect & | operator= (const RoundedRect & other) noexcept |
| | RoundedRect (RoundedRect && other) noexcept |
| RoundedRect & | operator= (RoundedRect && other) noexcept |
| void | set (const Gdk::Graphene::Rect & bounds, const Gdk::Graphene::Size & top_left, const Gdk::Graphene::Size & top_right, const Gdk::Graphene::Size & bottom_right, const Gdk::Graphene::Size & bottom_left) |
| | Initializes a rounded rectangle with the given values.
|
| void | set (const Gdk::Graphene::Rect & bounds, float radius) |
| | Initializes a rounded rectangle to the given bounds and sets the radius of all four corners equally.
|
| std::pair< Gdk::Graphene::Rect, std::array< Gdk::Graphene::Size, 4 > > | get () const |
| | Get the bounding rectangle and the corner radii.
|
| void | normalize () |
| | Normalizes a rounded rectangle.
|
| void | offset (float dx, float dy) |
| | Offsets the rounded rectangle's origin by dx and dy.
|
| void | 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.
|
| bool | is_rectilinear () const |
| | Checks if all corners of a rounded rectangle are right angles and the rectangle covers all of its bounds.
|
| bool | contains (const Gdk::Graphene::Point & point) const |
| | Checks if the given point is inside the rounded rectangle.
|
| bool | contains (const Gdk::Graphene::Rect & rect) const |
| | Checks if the given rectangle is contained inside the rounded rectangle.
|
| bool | intersects (const Gdk::Graphene::Rect & rect) const |
| | Checks if part a rectangle is contained inside the rounded rectangle.
|
| GskRoundedRect * | gobj () |
| | Provides access to the underlying C GObject.
|
| const GskRoundedRect * | gobj () const |
| | Provides access to the underlying C GObject.
|
A rectangular region with rounded corners.
Application code should normalize rectangles using 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 Gsk::RoundedRect as an argument will internally operate on a normalized copy; all functions returning a Gsk::RoundedRect will always return a normalized one.
The algorithm used for normalizing corner sizes is described in the CSS specification.
- Since gtkmm 4.20
| void Gsk::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.
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 rounded rectangles if you pass negative values for the top, right, bottom or left.
- Parameters
-
| top | How far to move the top side downwards. |
| right | How far to move the right side to the left. |
| bottom | How far to move the bottom side upwards. |
| left | How far to move the left side to the right. |