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.

Constructors

this
this(GskRoundedRect* gskRoundedRect, bool ownedRef)

Sets our main struct and passes it to the parent class.

Members

Functions

containsPoint
bool containsPoint(Point point)

Checks if the given @point is inside the rounded rectangle.

containsRect
bool containsRect(Rect rect)

Checks if the given @rect is contained inside the rounded rectangle.

getRoundedRectStruct
GskRoundedRect* getRoundedRectStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

init
RoundedRect init(Rect bounds, Size topLeft, Size topRight, Size bottomRight, Size bottomLeft)

Initializes the given GskRoundedRect with the given values.

initCopy
RoundedRect initCopy(RoundedRect src)

Initializes @self using the given @src rectangle.

initFromRect
RoundedRect initFromRect(Rect bounds, float radius)

Initializes @self to the given @bounds and sets the radius of all four corners to @radius.

intersectsRect
bool intersectsRect(Rect rect)

Checks if part of the given @rect is contained inside the rounded rectangle.

isRectilinear
bool isRectilinear()

Checks if all corners of @self are right angles and the rectangle covers all of its bounds.

normalize
RoundedRect normalize()

Normalizes the passed rectangle.

offset
RoundedRect offset(float dx, float dy)

Offsets the bound's origin by @dx and @dy.

shrink
RoundedRect shrink(float top, float right, float bottom, float left)

Shrinks (or grows) the given rectangle by moving the 4 sides according to the offsets given.

Variables

gskRoundedRect
GskRoundedRect* gskRoundedRect;

the main Gtk struct

ownedRef
bool ownedRef;
Undocumented in source.

Meta