I

IMutableRectangle

Interface for mutable rectangles aligned to the axes in 2D coordinate space with double precision coordinates.
ImplementsInheritance Hierarchy

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

Gets the coordinates of the bottom left corner of the rectangle as a Point.
readonly
Gets the coordinates of the bottom right corner of the rectangle as a Point.
readonly
Gets the coordinates of the center of the rectangle as a Point.
readonly
Gets the center x-coordinate of the rectangle.
readonly
Gets the center y-coordinate of the rectangle.
readonly
Gets or sets the height of this instance.
Implementations 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.height
Determines whether the specified size is empty.
ISize instances are considered empty if their width or height is less than 0.0d.
readonly

Implements

ISize.isEmpty

Defined in

ISize.isEmpty
Gets the maximum x-coordinate of the rectangle.
This is the x-coordinate of the right side of the rectangle, or the left side if the rectangle is empty.
readonly

Defined in

IRectangle.maxX
Gets the maximum y-coordinate of the rectangle.
This is the y-coordinate of the bottom side of the rectangle, or the top side if the rectangle is empty.
readonly

Defined in

IRectangle.maxY
Gets the current size of the rectangle as Size.
readonly

Defined in

IRectangle.size
Gets the coordinates of the top left corner of the rectangle as a Point.
readonly
Gets the coordinates of the top right corner of the rectangle as a Point.
readonly
Gets or sets the width of this instance.
Implementations 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.width
Gets or sets the x-coordinate for this point.
Implementations 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.x

Implemented in

MutableRectangle.x
Gets or sets the y-coordinate for this point.
Implementations 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.y

Implemented in

MutableRectangle.y

Methods

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.

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.

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
true iff the point lies inside the 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
true if the given rectangle contains the provided rectangle, false otherwise.
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.

Parameters

location: IPoint
The new location.
Applies a new position to a given mutable rectangle.

Parameters

x: number
The new x-coordinate.
y: number
The new y-coordinate.
Applies a new position and size to a given mutable rectangle.

Parameters

newRectangle: IRectangle
The bounds to set for the rectangle.
Applies a new position and size to a given mutable rectangle.

Parameters

position: IPoint
The new location.
size: ISize
The new size.
Applies a new position and size to a given mutable 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.

Parameters

newSize: ISize
The new location.
Sets the coordinates of the size to the given values.

Parameters

newWidth: number
The new x-coordinate
newHeight: number
The new y-coordinate
Creates a Rect instance with the current values of this rectangle.
This 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.

Return Value

Rect
A Rect that holds the values of the rectangle at the time of the invocation.

See Also

API
toMutableRectangle
Creates a new Size instance with the current values of this size.

Return Value

Size
A new Size instance that has been initialized with the current values of size.

Implements

ISize.toSize

Defined in

ISize.toSize