- I
- I
- I
- I
- I
Remarks
See Also
API
- Rect, IRectangle
Members
Constructors
Creates a new instance initialized to the values of the provided argument.
Parameters
- rectangle: IRectangle
- The rectangle whose values are used to initialize the new instance.
Creates a new instance using the provided implementation for the storage of the position and size of the rectangle.
Parameters
- location: IMutablePoint
- The provider for the dynamic position of this instance.
- size: IMutableSize
- The provider for the dynamic size of this instance.
Parameters
Parameters
- x: number
- The x-coordinate of the upper left corner of the rectangle.
- y: number
- The y-coordinate of the upper left corner of the rectangle.
- width: number
- The width of the rectangle.
- height: number
- The height of the rectangle.
Properties
Defined in
IRectangle.bottomLeftDefined in
IRectangle.bottomRightDefined in
IRectangle.centerDefined in
IRectangle.centerXDefined in
IRectangle.centerYGets the position of this rectangle.
Gets the size of this rectangle.
Gets or sets the height of this instance from the dynamicSize instance.
Implements
IMutableSize.heightDefined in
ISize.isEmptyDefined in
IRectangle.maxXDefined in
IRectangle.maxYDefined in
IRectangle.sizeDefined in
IRectangle.topLeftDefined in
IRectangle.topRightGets or sets the width of this instance from the dynamicSize instance.
Implements
IMutableSize.widthGets or sets the x-coordinate of the upper left corner of this instance from the dynamicLocation instance.
Implements
IMutableRectangle.xGets or sets the y-coordinate of the upper left corner of this instance from the dynamicLocation instance.
Implements
IMutableRectangle.yMethods
Adds a rectangle to another one.
Parameters
- rectangle2: IRectangle
- The rectangle to be added.
Defined in
IMutableRectangle.addAdds 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.
Defined in
IMutableRectangle.addCreate a clone of this object.
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.
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.containsRectangleParameters
- other: any
- the other object to compare for equality
Return Value
- boolean
trueifotheris considered equal to this instance.
The hash code is a numeric value that can be used to treat this object as a key in a hash table or similar data structure.
Two objects that are considered equal must have the same hash code. However, the reverse does not hold and two objects having the same hash code don't have to be equal. Ideally, the hash code should be roughly uniformly-distributed to prevent hash tables from performing poorly. Calculating the hash code is also a potentially frequent operation and should therefore be fast.
Return Value
- number
- the hash code for this object
Sets the center of the rectangle to the provided value.
Parameters
- center: Point
- The new center coordinates.
Defined in
IMutableRectangle.setCenterApplies a new position to a given mutable rectangle.
Parameters
- x: number
- The new x-coordinate.
- y: number
- The new y-coordinate.
Defined in
IMutableRectangle.setLocationApplies a new position and size to a given mutable rectangle.
Parameters
- newRectangle: IRectangle
- The bounds to set for the
rectangle.
Defined in
IMutableRectangle.setShapeParameters
Defined in
IMutableRectangle.setShapeParameters
- 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.
Defined in
IMutableRectangle.setShapeSets 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.setSizeCreates a Rect from a given MutableRectangle.
Return Value
Defined in
ISize.toSizeStatic Methods
Performs an explicit conversion from Rect to MutableRectangle.
Parameters
- rectangle: Rect
- The rectangle to convert.
Return Value
- MutableRectangle
- The result of the conversion.
Performs an explicit conversion from MutableRectangle to Rect.
Parameters
- rectangle: MutableRectangle
- The rectangle to convert.
Return Value
- Rect
- The result of the conversion.