|
|||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||
This is an axis parallel bounding box.
| Field Summary | |
|---|---|
Number |
maxX
right side of the box |
Number |
maxY
lower side of the box |
Number |
minX
left side of the box |
Number |
minY
upper side of the box |
| Constructor Summary | |
|---|---|
GraphBounds(/*Number*/ minX, /*Number*/ maxX, /*Number*/ minY, /*Number*/ maxY)
This is an axis parallel bounding box. |
|
| Method Summary | |
|---|---|
Number |
area()
returns the area. |
Number |
height()
returns the height. |
GraphBounds |
intersect(/*GraphBounds*/ another)
returns a new instance which is the intersection of this and another. |
GraphBounds |
round()
returns a new instance with Math.floor() applied to all four parameters. |
GraphBounds |
scale(/*Number*/ factor)
returns a new instance for which all four parameters (see the constructor) are multplied with the given factor. |
GraphBounds |
shift(/*Number*/ deltaX, /*Number*/ deltaY)
returns a new instance which is this shifted by deltaX in x direction and shifted by deltaY in y direction. |
GraphBounds |
union(/*GraphBounds*/ another)
returns a new instance which is the union of this and another. |
Number |
width()
returns the width. |
| Field Detail |
|---|
/*Number*/ maxX
/*Number*/ maxY
/*Number*/ minX
/*Number*/ minY
| Constructor Detail |
|---|
GraphBounds(/*Number*/ minX, /*Number*/ maxX, /*Number*/ minY, /*Number*/ maxY)
minX - left side of the box
maxX - right side of the box
minY - upper side of the box
maxY - lower side of the box
| Method Detail |
|---|
Number area()
Number height()
GraphBounds intersect(/*GraphBounds*/ another)
another - another GraphBounds instance
GraphBounds round()
GraphBounds scale(/*Number*/ factor)
factor - the scaling factor
GraphBounds shift(/*Number*/ deltaX, /*Number*/ deltaY)
deltaX - shift amount in x direction
deltaY - shift amount in y direction
GraphBounds union(/*GraphBounds*/ another)
another - another GraphBounds instance
Number width()