Gdk.Rectangle
Description: Reference for Gdk.Rectangle

### Struct

# GdkRectangle

since: 4.0

#### Description [src]

    struct GdkRectangle {
      int x;
      int y;
      int width;
      int height;
    }

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 `gdk_rectangle_intersect()`; to find the union of two rectangles use `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.

###### Structure members

`x`

  The x coordinate of the top left corner.

`y`

  The y coordinate of the top left corner.

`width`

  The width of the rectangle.

`height`

  The height of the rectangle.

Available since: 4.0

#### Instance methods

###### gdk_rectangle_contains_point

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

since: 4.0

###### gdk_rectangle_equal

Checks if the two given rectangles are equal.

since: 4.0

###### gdk_rectangle_intersect

Calculates the intersection of two rectangles.

since: 4.0

###### gdk_rectangle_union

Calculates the union of two rectangles.

since: 4.0