Rectangle

A gtk.types.Rectangle data type for representing rectangles.

gtk.types.Rectangle is identical to cairo.types.Rectangle. Together with Cairo’s cairo.region.Region data type, these are the central types for representing sets of pixels.

The intersection of two rectangles can be computed with gdk.rectangle.Rectangle.intersect; to find the union of two rectangles use gdk.rectangle.Rectangle.union_.

The cairo.region.Region 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.

Members

Functions

containsPoint
bool containsPoint(int x, int y)

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

equal
bool equal(gdk.rectangle.Rectangle rect2)

Checks if the two given rectangles are equal.

intersect
bool intersect(gdk.rectangle.Rectangle src2, gdk.rectangle.Rectangle dest)

Calculates the intersection of two rectangles.

union_
void union_(gdk.rectangle.Rectangle src2, gdk.rectangle.Rectangle dest)

Calculates the union of two rectangles.

Properties

_gType
GType _gType [@property getter]

Static functions

_getGType
GType _getGType()

Variables

height
int height;

the height of the rectangle

width
int width;

the width of the rectangle

x
int x;

the x coordinate of the top left corner

y
int y;

the y coordinate of the top left corner