Options
All
  • Public
  • Public/Protected
  • All
Menu

Extends Point to implement a 2-dimensional rectangle with double precision coordinates.

Constructor: mxRectangle

Constructs a new rectangle for the optional parameters. If no parameters are given then the respective default values are used.

Hierarchy

Index

Constructors

constructor

  • new Rectangle(x?: number, y?: number, width?: number, height?: number): Rectangle

Properties

_height

_height: number = 0

Holds the height of the rectangle. Default is 0.

_width

_width: number = 0

Holds the width of the rectangle. Default is 0.

_x

_x: number = 0

Holds the x-coordinate of the point. Default is 0.

_y

_y: number = 0

Holds the y-coordinate of the point. Default is 0.

Accessors

height

  • get height(): number
  • set height(height: number): void

width

  • get width(): number
  • set width(width: number): void

x

  • get x(): number
  • set x(x: number): void

y

  • get y(): number
  • set y(y: number): void

Methods

add

clone

equals

getCenterX

  • getCenterX(): number

getCenterY

  • getCenterY(): number

getPoint

grow

  • grow(amount: number): void
  • Grows the rectangle by the given amount, that is, this method subtracts the given amount from the x- and y-coordinates and adds twice the amount to the width and height.

    Parameters

    • amount: number

    Returns void

intersect

rotate90

  • rotate90(): void

setRect

  • setRect(x: number, y: number, width: number, height: number): void
  • Sets this rectangle to the specified values

    Parameters

    • x: number
    • y: number
    • width: number
    • height: number

    Returns void

Static fromRectangle

Generated using TypeDoc