Represents a mutable axis-aligned rectangle in two-dimensional Cartesian coordinates.
Remarks
Type Details
- yFiles module
- core
See Also
Constructors
Creates a new instance using the provided implementation for the storage of the position and size of the rectangle.
Remarks
Parameters
A map of options to pass to the method.
- location - IMutablePoint
- The provider for the dynamic position of this instance.
- size - IMutableSize
- The provider for the dynamic size of this instance.
Creates a new instance using the provided values to initialize the position and size.
Remarks
Parameters
A map of options to pass to the method.
- 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.
Creates a new instance using the provided values to initialize the position and size.
Remarks
Parameters
A map of options to pass to the method.
Creates a new instance initialized to the values of the provided argument.
Parameters
A map of options to pass to the method.
- rectangle - IRectangle
- The rectangle whose values are used to initialize the new instance.
Properties
Gets the coordinates of the bottom left corner of the rectangle as a Point.
Overrides
Gets the coordinates of the bottom right corner of the rectangle as a Point.
Overrides
Gets the coordinates of the center of the rectangle as a Point.
Overrides
Gets the center x-coordinate of the rectangle.
Overrides
Gets the center y-coordinate of the rectangle.
Overrides
Gets the position of this rectangle.
Remarks
Gets the size of this rectangle.
Remarks
Gets or sets the height of this instance from the dynamicSize instance.
Remarks
See Also
Implements
Determines whether the specified size is empty.
Remarks
Overrides
Gets the maximum x-coordinate of the rectangle.
Remarks
Overrides
Gets the maximum y-coordinate of the rectangle.
Remarks
Overrides
Gets the current size of the rectangle as Size.
Overrides
Gets the coordinates of the top left corner of the rectangle as a Point.
Overrides
Gets the coordinates of the top right corner of the rectangle as a Point.
Overrides
Gets or sets the width of this instance from the dynamicSize instance.
Remarks
See Also
Implements
Gets or sets the x-coordinate of the upper left corner of this instance from the dynamicLocation instance.
Remarks
See Also
Implements
Gets or sets the y-coordinate of the upper left corner of this instance from the dynamicLocation instance.
Remarks
See Also
Implements
Methods
Adds a rectangle to another one.
Remarks
Parameters
A map of options to pass to the method.
- rectangle2 - IRectangle
- The rectangle to be added.
Defined in
Adds a point to a rectangle, possibly enlarging the rectangle.
Remarks
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
A map of options to pass to the method.
- point - IPoint
- The coordinate to include in the bounds.
Defined in
Create a clone of this object.
Determines whether the given rectangle contains the provided point.
Parameters
A map of options to pass to the method.
- 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.
Returns
- ↪boolean
true
iff the point lies inside the rectangle.
Overrides
Determines whether the given rectangle contains the provided rectangle.
Remarks
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
A map of options to pass to the method.
- other - IRectangle
- The rectangle to test.
- eps - number
- A positive value allows for fuzzy hit testing.
Returns
- ↪boolean
true
if the given rectangle contains the provided rectangle,false
otherwise.
Overrides
Returns a hash code for this object.
Remarks
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.
Returns
- ↪number
- the hash code for this object
Sets the center of the rectangle to the provided value.
Remarks
Parameters
A map of options to pass to the method.
- center - Point
- The new center coordinates.
Defined in
Applies a new position to a given mutable rectangle.
Parameters
A map of options to pass to the method.
- x - number
- The new x-coordinate.
- y - number
- The new y-coordinate.
Defined in
Applies a new position to a given mutable rectangle.
Parameters
A map of options to pass to the method.
- location - IPoint
- The new location.
Defined in
Applies a new position and size to a given mutable rectangle.
Parameters
A map of options to pass to the method.
- 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
Applies a new position and size to a given mutable rectangle.
Parameters
A map of options to pass to the method.
- newRectangle - IRectangle
- The bounds to set for the
rectangle
.
Defined in
Applies a new position and size to a given mutable rectangle.
Parameters
A map of options to pass to the method.
Defined in
Sets the coordinates of the size to the given values.
Parameters
A map of options to pass to the method.
- newWidth - number
- The new x-coordinate
- newHeight - number
- The new y-coordinate
Overrides
Sets the coordinates of the size to the given values.
Parameters
A map of options to pass to the method.
- newSize - ISize
- The new location.
Overrides
Creates a Rect from a given MutableRectangle.
Creates a new Size instance with the current values of this size.
Returns
Overrides
Static Methods
Performs an explicit conversion from Rect to MutableRectangle.
Parameters
A map of options to pass to the method.
- rectangle - Rect
- The rectangle to convert.
Returns
- ↪MutableRectangle
- The result of the conversion.
Performs an explicit conversion from MutableRectangle to Rect.
Parameters
A map of options to pass to the method.
- rectangle - MutableRectangle
- The rectangle to convert.
Returns
- ↪Rect
- The result of the conversion.