/**
 * A Rect describes the size and position of a rectangle.
 */ export class Rect { /** The X coordinate of the Rect's origin (top-left corner of the rectangle). */ public x = 0 ; /** The Y coordinate of the Rect's origin (top-left corner of the rectangle). */ public y = 0 ; /** The width of the Rect. */ public width = 0 ; /** The height of the Rect. */ public height = 0 ; param rect public static from ( rect = { } ) { return new this ( rect . x || rect . left , rect . y || rect . top , rect . width , rect . height ) ; } param rect1 param rect2 public static isEqual ( rect1 , rect2 ) { return rect1 . x === rect2 . x && rect1 . y === rect2 . y && rect1 . width === rect2 . width && rect1 . height === rect2 . height ; } public constructor ( x ? , y ? , width ? , height ? ) { this . x = x || 0 ; this . y = y || 0 ; this . width = width || 0 ; this . height = height || 0 ; } /**
     * Get the top coordinate value of the Rect (has the same value as y).
     */ public get top ( ) : number { return this . y ; } /**
     * Get the left coordinate value of the Rect (has the same value as x).
     */ public get left ( ) : number { return this . x ; } /**
     * Get the right coordinate value of the DOMRect.
     */ public get right ( ) : number { return this . x + this . width ; } /**
     * Get the bottom coordinate value of the Rect.
     */ public get bottom ( ) : number { return this . y + this . height ; } /**
     * Get the center X coordinate value of the Rect.
     */ public get cx ( ) : number { return this . x + this . width / 2 ; } /**
     * Get the center Y coordinate value of the Rect.
     */ public get cy ( ) : number { return this . y + this . height / 2 ; } param increment public grow ( increment ) { this . y -= increment ; this . x -= increment ; this . height += 2 * increment ; this . width += 2 * increment ; return this ; } param decrement public shrink ( decrement ) { return this . grow ( - decrement ) ; } }