case class Bounds(x: Double, y: Double, width: Double, height: Double) extends Product with Serializable
This class is used to represent rectangular bounds. In some cases it is full pixel size bounds for rending. In many cases it is used with values between 0.0 and 1.0 to represent a fractional bounds.
- Alphabetic
- By Inheritance
- Bounds
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Bounds(x: Double, y: Double, width: Double, height: Double)
Value Members
-
def
centerX: Double
Calculates the center of the bounds in X.
-
def
centerY: Double
Calculates the center of the bounds in Y.
- val height: Double
-
def
join(that: Bounds): Bounds
Returns a bounds object that contains both this and that.
Returns a bounds object that contains both this and that.
- that
Another bounds to join with this one.
-
def
subX(min: Double, max: Double): Bounds
Produces a new Bounds object with range in X determined by the fractional min and max arguments.
Produces a new Bounds object with range in X determined by the fractional min and max arguments. Passing 0.0 and 1.0 would reproduce the original object.
- min
The fractional relative minimum bound.
- max
The fractional relative maximum bound.
-
def
subXY(b: Bounds): Bounds
Produces a new Bounds object with range in X and Y determined by the fractional bounds object.
-
def
subXY(minx: Double, maxx: Double, miny: Double, maxy: Double): Bounds
Produces a new Bounds object with range in X and Y determined by the fractional min and max arguments.
Produces a new Bounds object with range in X and Y determined by the fractional min and max arguments. Passing 0.0, 1.0, 0.0, 1.0 would reproduce the original object.
- minx
The fractional relative minimum bound for X.
- maxx
The fractional relative maximum bound for X.
- miny
The fractional relative minimum bound for Y.
- maxy
The fractional relative maximum bound for Y.
-
def
subXYBorder(minxBorder: Double, maxxBorder: Double, minyBorder: Double, maxyBorder: Double): Bounds
Produces a new Bounds with absolute offsets for the X and Y values.
Produces a new Bounds with absolute offsets for the X and Y values.
- minxBorder
The absolute width of the X offset on the minimum edge.
- maxxBorder
The absolute width of the X offset on the maximum edge.
- minyBorder
The absolute height of the Y offset on the minimum edge.
- maxyBorder
The absolute height of the Y offset on the maximum edge.
-
def
subY(min: Double, max: Double): Bounds
Produces a new Bounds object with range in Y determined by the fractional min and max arguments.
Produces a new Bounds object with range in Y determined by the fractional min and max arguments. Passing 0.0 and 1.0 would reproduce the original object.
- min
The fractional relative minimum bound.
- max
The fractional relative maximum bound.
- val width: Double
- val x: Double
- val y: Double