A mutable rectangle in 2D coordinate space with double precision values stored in an instance of IMutablePoint and IMutableSize.
Remarks
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.geometry.MutableRectangle
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.
Properties
Gets the anchor location of the oriented rectangle as a Point struct.
Defined in
Gets the x coordinate of the location.
Remarks
Implements
Gets the y coordinate of the location plus the height.
Remarks
Implements
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
Determines the bounds of an oriented rectangle.
Gets the coordinates of the center of the rectangle as a Point.
Overrides
Gets or sets the height of this instance from the size instance.
Remarks
See Also
Implements
Gets whether this instance has negative width or height.
Overrides
Gets the position of this rectangle.
Remarks
Gets the maximum X coordinate of the rectangle.
Remarks
Overrides
Gets the maximum Y coordinate of the rectangle.
Remarks
Overrides
Gets the current center of the oriented rectangle as a Point struct.
Defined in
Gets the size of this rectangle.
Remarks
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 the up vector of the oriented rectangle as a Point struct.
Defined in
Gets the x value of the up vector which is always 0
Remarks
Implements
Gets the y value of the up vector which is always -1
Remarks
Implements
Gets or sets the width of this instance from the size instance.
Remarks
See Also
Implements
Gets or sets the x coordinate of the upper left corner of this instance from the location instance.
Gets or sets the x coordinate of the lower right corner of this instance using the location and size instances.
Remarks
Gets or sets the y coordinate of the upper left corner of this instance from the location instance.
Gets or sets the y coordinate of the lower right corner of this instance using the location and size instances.
Remarks
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
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.
Returns
- ↪boolean
true
iff the point lies inside the rectangle.
Overrides
Determines whether the given oriented rectangle contains the provided point, using an epsilon value.
Parameters
A map of options to pass to the method.
- point - Point
- The coordinates of the point to test.
- eps - number
- A positive value allows for fuzzy hit testing. If the point lies outside the given object but it's 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.
Defined in
Creates a transformation matrix that can be used to transform points that are in the local coordinate system of the oriented rectangle if the top-left corner is the origin.
Returns
- ↪Matrix
- A matrix that can be used to transform from oriented rectangle coordinates to world coordinates.
Defined in
Calculates the Euclidean distance between two points.
Parameters
A map of options to pass to the method.
- point2 - IPoint
- The second point.
Returns
- ↪number
- The distance between the two points.
Overrides
Creates an enlarged instance that is the same as this one but enlarged by the specified padding.
Parameters
A map of options to pass to the method.
- padding - Insets
- The padding to use to add to the instance.
Returns
- ↪OrientedRectangle
- A new OrientedRectangle instance which is enlarged by the given
padding
.
Defined in
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
Determines whether the oriented rectangle contains the provided point, using an epsilon value.
Parameters
A map of options to pass to the method.
- location - Point
- The coordinates of the point to test.
- eps - number
- A positive value allows for fuzzy hit testing. If the point lies outside the given object but it's 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.
Defined in
Sets the coordinates of the point to the given values.
Parameters
A map of options to pass to the method.
- x - number
- The new x coordinate
- y - number
- The new y coordinate
Overrides
Sets the coordinates of the point to the given values.
Parameters
A map of options to pass to the method.
- location - IPoint
- The new location.
Overrides
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 to 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
Sets the center of the rectangle to the provided value.
Parameters
A map of options to pass to the method.
- center - Point
- The new center coordinates.
Defined in
Creates the union of two rectangles, placing the result in the this parameter.
Remarks
Parameters
A map of options to pass to the method.
- rectangle1 - IRectangle
- The first rectangle to create the union of.
- rectangle2 - IRectangle
- The second rectangle to create the union of.
Defined in
Creates a YOrientedRectangle from a given IOrientedRectangle.
Returns
Class.ensure(LayoutExecutor)
More information.