Rectangle

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

A GdkRectangle data type for representing rectangles.

GdkRectangle is identical to cairo_rectangle_t. Together with Cairo’s cairo_region_t data type, these are the central types for representing sets of pixels.

The intersection of two rectangles can be computed with method@Gdk.Rectangle.intersect; to find the union of two rectangles use method@Gdk.Rectangle.union.

The cairo_region_t type provided by Cairo is usually used for managing non-rectangular clipping of graphical operations.

The Graphene library has a number of other data types for regions and volumes in 2D and 3D.

Constructors

Link copied to clipboard
constructor()

Allocate a new Rectangle.

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

Allocate a new Rectangle using the provided AutofreeScope.

constructor(x: <Error class: unknown class>, y: <Error class: unknown class>, width: <Error class: unknown class>, height: <Error class: unknown class>)

Allocate a new Rectangle.

constructor(x: <Error class: unknown class>, y: <Error class: unknown class>, width: <Error class: unknown class>, height: <Error class: unknown class>, scope: <Error class: unknown class>)

Allocate a new Rectangle using the provided AutofreeScope.

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

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val gdkRectanglePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
var height: <Error class: unknown class>

the height of the rectangle

Link copied to clipboard
var width: <Error class: unknown class>

the width of the rectangle

Link copied to clipboard
var x: <Error class: unknown class>

the x coordinate of the top left corner

Link copied to clipboard
var y: <Error class: unknown class>

the y coordinate of the top left corner

Functions

Link copied to clipboard
fun containsPoint(x: <Error class: unknown class>, y: <Error class: unknown class>): Boolean

Returns true if @rect contains the point described by @x and @y.

Link copied to clipboard
fun equal(rect2: Rectangle): Boolean

Checks if the two given rectangles are equal.

Link copied to clipboard
fun intersect(src2: Rectangle, dest: Rectangle?): Boolean

Calculates the intersection of two rectangles.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun union(src2: Rectangle, dest: Rectangle)

Calculates the union of two rectangles.