RoundedRect

class RoundedRect(pointer: <Error class: unknown class><<Error class: unknown class>>, cleaner: <Error class: unknown class>? = null)

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.

Skipped during bindings generation

  • field bounds: Graphene.Rect

  • field corner: Graphene.Size

Constructors

Link copied to clipboard
constructor()

Allocate a new RoundedRect.

constructor(scope: <Error class: unknown class>)

Allocate a new RoundedRect using the provided AutofreeScope.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>, cleaner: <Error class: unknown class>? = null)

Properties

Link copied to clipboard
val gskRoundedRectPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
fun containsPoint(point: <Error class: unknown class>): Boolean

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

Link copied to clipboard
fun containsRect(rect: <Error class: unknown class>): Boolean

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

Link copied to clipboard
fun init(bounds: <Error class: unknown class>, topLeft: <Error class: unknown class>, topRight: <Error class: unknown class>, bottomRight: <Error class: unknown class>, bottomLeft: <Error class: unknown class>): RoundedRect

Initializes the given GskRoundedRect with the given values.

Link copied to clipboard

Initializes @self using the given @src rectangle.

Link copied to clipboard
fun initFromRect(bounds: <Error class: unknown class>, radius: <Error class: unknown class>): RoundedRect

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

Link copied to clipboard
fun intersectsRect(rect: <Error class: unknown class>): Boolean

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

Link copied to clipboard

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

Link copied to clipboard

Normalizes the passed rectangle.

Link copied to clipboard
fun offset(dx: <Error class: unknown class>, dy: <Error class: unknown class>): RoundedRect

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

Link copied to clipboard
fun shrink(top: <Error class: unknown class>, right: <Error class: unknown class>, bottom: <Error class: unknown class>, left: <Error class: unknown class>): RoundedRect

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