ImmutableBox
public final class ImmutableBox extends Box
An immutable axis-aligned rectangle. See MutableBox for a mutable version.
Note that unlike android.graphics.RectF, this does not express an opinion about axis direction (e.g. the positive Y axis being "down"), because it is intended to be used with any coordinate system rather than just Android screen / View space.
Summary
Nested types |
|---|
public static class ImmutableBox.Companion |
Public methods |
|
|---|---|
boolean |
|
static final @NonNull ImmutableBox |
fromCenterAndDimensions(Constructs an |
static final @NonNull ImmutableBox |
fromTwoPoints(@NonNull Vec point1, @NonNull Vec point2)Constructs the smallest |
float |
getXMax()The upper bound in the |
float |
getXMin()The lower bound in the |
float |
getYMax()The upper bound in the |
float |
getYMin()The lower bound in the |
int |
hashCode() |
@NonNull String |
toString() |
Inherited methods |
||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public methods
fromCenterAndDimensions
public static final @NonNull ImmutableBox fromCenterAndDimensions(
@NonNull Vec center,
@FloatRange(from = 0.0) float width,
@FloatRange(from = 0.0) float height
)
Constructs an ImmutableBox with a given center, width, and height.
fromTwoPoints
public static final @NonNull ImmutableBox fromTwoPoints(@NonNull Vec point1, @NonNull Vec point2)
Constructs the smallest ImmutableBox containing the two given points.