Class OpenSeadragon.Rect
- Defined in: openseadragon.js
Constructor Attributes | Constructor Name and Description |
---|---|
OpenSeadragon.Rect(x, y, width, height)
A Rectangle really represents a 2x2 matrix where each row represents a
2 dimensional vector component, the first is (x,y) and the second is
(width, height).
|
Method Summary
Class Detail
OpenSeadragon.Rect(x, y, width, height)
A Rectangle really represents a 2x2 matrix where each row represents a
2 dimensional vector component, the first is (x,y) and the second is
(width, height). The latter component implies the equation of a simple
plane.
- Parameters:
- {Number} x
- The vector component 'x'.
- {Number} y
- The vector component 'y'.
- {Number} width
- The vector component 'height'.
- {Number} height
- The vector component 'width'.
Field Detail
{Number}
height
The vector component 'height'.
{Number}
width
The vector component 'width'.
{Number}
x
The vector component 'x'.
{Number}
y
The vector component 'y'.
Method Detail
-
{Boolean} equals(rectangle)Determines if two Rectanlges have equivalent components.
- Parameters:
- {OpenSeadragon.Rect} rectangle
- The Rectangle to compare to.
- Returns:
- {Boolean} 'true' if all components are equal, otherwise 'false'.
-
{Number} getAspectRatio()The aspect ratio is simply the ratio of width to height.
- Returns:
- {Number} The ratio of width to height.
-
{OpenSeadragon.Point} getBottomRight()Provides the coordinates of the bottom-right corner of the rectangle as a point.
- Returns:
- {OpenSeadragon.Point} The coordinate of the bottom-right corner of the rectangle.
-
{OpenSeadragon.Point} getCenter()Computes the center of the rectangle.
- Returns:
- {OpenSeadragon.Point} The center of the rectangle as represnted as represented by a 2-dimensional vector (x,y)
-
{OpenSeadragon.Point} getSize()Returns the width and height component as a vector OpenSeadragon.Point
- Returns:
- {OpenSeadragon.Point} The 2 dimensional vector represnting the the width and height of the rectangle.
-
{OpenSeadragon.Point} getTopLeft()Provides the coordinates of the upper-left corner of the rectanglea s a point.
- Returns:
- {OpenSeadragon.Point} The coordinate of the upper-left corner of the rectangle.
-
{String} toString()Provides a string representation of the retangle which is useful for debugging.
- Returns:
- {String} A string representation of the rectangle.