Rect
+ new Rect(value
: RectInput): Rect
Parameters:
Returns: Rect
• b: number
• l: number
• r: number
• t: number
• get height(): number
Returns: number
• get width(): number
Returns: number
▸ clone(): Rect‹›
Returns a copy of Rect that can be mutated separately.
Returns: Rect‹›
Copies all of this Rect's properties to a Rect specified in an argument. Returns the line passed as argument.
Parameters:
Returns: Rect‹›
▸ contains(x
: number, y
: number): boolean
Parameters:
Returns: boolean
▸ expand(expansion
: Rect | number): this
Expands this Rect by other Rect's dimensions (i.e. to reduce padding) or by a constant numeric value from each side. Resulting Rect is the same, mutated Rect.
Parameters:
Returns: this
▸ inset(shrink
: Rect | number): this
Shrinks this Rect by other Rect's dimensions (i.e. to apply padding) or by a constant numeric value from each side. Resulting Rect is the same, mutated Rect.
Parameters:
Returns: this
▸ intersects(rect
: Rect): boolean
Parameters:
Returns: boolean
▸ offset(offset
: Rect | Point): this
Moves this Rect by left top position of passed rect or by XY coordinates of a Point. Resulting Rect is the same, mutated Rect.
Parameters:
Returns: this
▸ offset(x
: number, y
: number): this
Moves this Rect by passed x and y coordinates. Resulting Rect is the same, mutated Rect.
Parameters:
Returns: this
▸ toString(): string
Returns: string
Static
from▸ from(rectLike
: RectLike): Rect
Parameters:
Returns: Rect
Name
Type
value
Name
Type
rect
Name
Type
x
number
y
number
Name
Type
expansion
Rect | number
Name
Type
shrink
Rect | number
Name
Type
rect
Name
Type
offset
Name
Type
x
number
y
number
Name
Type
rectLike