Comment on page
Rect
- Rect
Parameters:
Name | Type |
value |
• b: number
• l: number
• r: number
• t: number
• get height(): number
Returns: number
• get width(): number
Returns: number
Returns a copy of Rect that can be mutated separately.
Copies all of this Rect's properties to a Rect specified in an argument. Returns the line passed as argument.
Parameters:
Name | Type |
rect |
▸ contains(
x
: number, y
: number): booleanParameters:
Name | Type |
x | number |
y | number |
Returns: boolean
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:
Name | Type |
expansion |
Returns: 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:
Name | Type |
shrink |
Returns: this
Parameters:
Name | Type |
rect |
Returns: boolean
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): thisMoves this Rect by passed x and y coordinates. Resulting Rect is the same, mutated Rect.
Parameters:
Name | Type |
x | number |
y | number |
Returns: this
▸ toString(): string
Returns: string
Parameters:
Name | Type |
rectLike |
Last modified 3yr ago