Gjsify LogoGjsify Logo

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 [methodGdk.Rectangle.intersect]; to find the union of two rectangles use [methodGdk.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.

record

Hierarchy

  • Rectangle

Index

Constructors

Properties

height: number

the height of the rectangle

field
width: number

the width of the rectangle

field
x: number

the x coordinate of the top left corner

field
y: number

the y coordinate of the top left corner

field
name: string

Methods

  • contains_point(x: number, y: number): boolean
  • Returns %TRUE if rect contains the point described by x and y.

    Parameters

    • x: number

      X coordinate

    • y: number

      Y coordinate

    Returns boolean

  • Calculates the intersection of two rectangles.

    It is allowed for dest to be the same as either src1 or src2. If the rectangles do not intersect, dest’s width and height is set to 0 and its x and y values are undefined. If you are only interested in whether the rectangles intersect, but not in the intersecting area itself, pass %NULL for dest.

    Parameters

    Returns [boolean, Gdk.Rectangle]

  • Calculates the union of two rectangles.

    The union of rectangles src1 and src2 is the smallest rectangle which includes both src1 and src2 within it. It is allowed for dest to be the same as either src1 or src2.

    Note that this function does not ignore 'empty' rectangles (ie. with zero width or height).

    Parameters

    Returns Gdk.Rectangle

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method