Interface for mutable rectangles aligned to the axes in 2D coordinate space with double precision coordinates.
Implements
- I
- I
- I
Remarks
This interface provides read and write access to the features of the rectangle. This interface does not declare any additional methods. It combines the IMutablePoint interface that describes the upper left corner of the rectangle with the IMutableSize interface that describes the width and height of the rectangle.
See Also
API
- ISize, IPoint, MutableRectangle
Members
Show:
Properties
readonly
Defined in
IRectangle.bottomLeftreadonly
Defined in
IRectangle.bottomRightreadonly
Defined in
IRectangle.centerreadonly
Defined in
IRectangle.centerXreadonly
Defined in
IRectangle.centerYImplementations may adjust the values internally, e.g., to automatically snap the values to grid sizes. So depending on context, the value that can be read might not necessarily be the exact same value that has just been written.
abstract
See Also
API
- height
Implements
ISize.heightDefined in
IMutableSize.heightImplements
ISize.isEmptyDefined in
ISize.isEmptyThis is the x-coordinate of the right side of the rectangle, or the left side if the rectangle is empty.
readonly
Defined in
IRectangle.maxXThis is the y-coordinate of the bottom side of the rectangle, or the top side if the rectangle is empty.
readonly
Defined in
IRectangle.maxYreadonly
Defined in
IRectangle.sizereadonly
Defined in
IRectangle.topLeftreadonly
Defined in
IRectangle.topRightImplementations may adjust the values internally, e.g., to automatically snap the values to grid sizes. So depending on context, the value that can be read might not necessarily be the exact same value that has just been written.
abstract
See Also
API
- width
Implements
ISize.widthDefined in
IMutableSize.widthImplementations may adjust the coordinates internally, e.g., to automatically snap the coordinates to grid points. So depending on context, the value that can be read might not necessarily be the exact same value that has just been written.
abstract
See Also
API
- x
Implements
IRectangle.xImplemented in
MutableRectangle.xImplementations may adjust the coordinates internally, e.g., to automatically snap the coordinates to grid points. So depending on context, the value that can be read might not necessarily be the exact same value that has just been written.
abstract
See Also
API
- y
Implements
IRectangle.yImplemented in
MutableRectangle.yMethods
Adds a rectangle to another one.
Adds a rectangle to another one.
The result is placed into the first rectangle, which is returned. If either of the two rectangles is empty, i.e. its width or height is negative, the result will be the other rectangle. If either of the two rectangles is infinite, i.e. its width or height is positive infinity, the result is an infinite rectangle.
Parameters
- rectangle2: IRectangle
- The rectangle to be added.
Adds a point to a rectangle, possibly enlarging the rectangle.
Adds a point to a rectangle, possibly enlarging the rectangle.
If the rectangle is initially empty, i.e. its width or height is negative, the bounds of the rectangle will be set to (x, y, 0, 0).
If either the x- or y-coordinate of the given point is infinite, this method has an undefined result.
Parameters
- point: IPoint
- The coordinate to include in the bounds.
Determines whether the given rectangle contains the provided point.
Determines whether the given rectangle contains the provided point.
Parameters
- point: IPoint
- The point to test.
- eps?: number
- A positive value allows for fuzzy hit testing. If the point lies outside the given object but its distance is less than or equal to that value, it will be considered a hit.
Return Value
- boolean
trueiff the point lies inside the rectangle.
Defined in
IRectangle.containsDetermines whether the given rectangle contains the provided rectangle.
Determines whether the given rectangle contains the provided rectangle.
More formally, this rectangle contains the other rectangle if the coordinates of each point of the other rectangle are neither less than this rectangle's x and y minus eps nor greater than this rectangle's MaxX and MaxY plus eps.
Consequently, an empty rectangle neither contains any other rectangle nor is it contained in any other rectangle.
Note, the result of this method can be counterintuitive if this rectangle's x or y is positive or negative infinity.
Parameters
- other: IRectangle
- The rectangle to test.
- eps?: number
- A positive value allows for fuzzy hit testing.
Return Value
- boolean
trueif the given rectangle contains the provided rectangle,falseotherwise.
Defined in
IRectangle.containsRectangleSets the center of the rectangle to the provided value.
Sets the center of the rectangle to the provided value.
If the rectangle has either infinite width or infinite height, setting the center point has an undefined result.
Parameters
- center: Point
- The new center coordinates.
Applies a new position to a given mutable rectangle.
Applies a new position to a given mutable rectangle.
Parameters
- location: IPoint
- The new location.
Parameters
- x: number
- The new x-coordinate.
- y: number
- The new y-coordinate.
Applies a new position and size to a given mutable rectangle.
Applies a new position and size to a given mutable rectangle.
Parameters
- newRectangle: IRectangle
- The bounds to set for the
rectangle.
Parameters
- x: number
- The new x-coordinate of the upper left corner of the rectangle.
- y: number
- The new y-coordinate of the upper left corner of the rectangle.
- width: number
- The new width of the rectangle.
- height: number
- The new height of the rectangle.
Sets the coordinates of the size to the given values.
Sets the coordinates of the size to the given values.
Parameters
- newWidth: number
- The new x-coordinate
- newHeight: number
- The new y-coordinate
Defined in
IMutableSize.setSizeThis method can be used to obtain a copy of the current state of the rectangle and for using the utility methods that are available for the Rect type.