RoundedRect

A rectangular region with rounded corners.

Application code should normalize rectangles using gsk.rounded_rect.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 gsk.rounded_rect.RoundedRect as an argument will internally operate on a normalized copy; all functions returning a gsk.rounded_rect.RoundedRect will always return a normalized one.

The algorithm used for normalizing corner sizes is described in the CSS specification.

Members

Functions

containsPoint
bool containsPoint(graphene.point.Point point)

Checks if the given point is inside the rounded rectangle.

containsRect
bool containsRect(graphene.rect.Rect rect)

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

initCopy
gsk.rounded_rect.RoundedRect initCopy(gsk.rounded_rect.RoundedRect src)

Initializes self using the given src rectangle.

initFromRect
gsk.rounded_rect.RoundedRect initFromRect(graphene.rect.Rect bounds, float radius)

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

init_
gsk.rounded_rect.RoundedRect init_(graphene.rect.Rect bounds, graphene.size.Size topLeft, graphene.size.Size topRight, graphene.size.Size bottomRight, graphene.size.Size bottomLeft)

Initializes the given gsk.rounded_rect.RoundedRect with the given values.

intersectsRect
bool intersectsRect(graphene.rect.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
gsk.rounded_rect.RoundedRect normalize()

Normalizes the passed rectangle.

offset
gsk.rounded_rect.RoundedRect offset(float dx, float dy)

Offsets the bound's origin by dx and dy.

shrink
gsk.rounded_rect.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.