RoundedRect

class RoundedRect(pointer: <Error class: unknown class><<Error class: unknown class>>)

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: Fields with arrays are not supported

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

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: Float): 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: Float, dy: Float): RoundedRect

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

Link copied to clipboard
fun shrink(top: Float, right: Float, bottom: Float, left: Float): RoundedRect

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