ImmutableBox.Companion



Summary

Public functions

ImmutableBox
fromCenterAndDimensions(
    center: Vec,
    width: @FloatRange(from = 0.0) Float,
    height: @FloatRange(from = 0.0) Float
)

Constructs an ImmutableBox with a given center, width, and height.

android
ImmutableBox
fromTwoPoints(point1: Vec, point2: Vec)

Constructs the smallest ImmutableBox containing the two given points.

android

Extension functions

ImmutableBox?

Constructs an ImmutableBox with the values from rect.

android
ImmutableBox?

If rect is not empty, returns an ImmutableBox constructed from the values of rect.

android
ImmutableBox?

If rect is not empty, returns an ImmutableBox constructed from the values of rect.

android

Public functions

fromCenterAndDimensions

fun fromCenterAndDimensions(
    center: Vec,
    width: @FloatRange(from = 0.0) Float,
    height: @FloatRange(from = 0.0) Float
): ImmutableBox

Constructs an ImmutableBox with a given center, width, and height.

fromTwoPoints

fun fromTwoPoints(point1: Vec, point2: Vec): ImmutableBox

Constructs the smallest ImmutableBox containing the two given points.

Extension functions

from

fun ImmutableBox.Companion.from(rect: RectF): ImmutableBox?

Constructs an ImmutableBox with the values from rect.

If rect is empty, returns null instead.

Java callers should prefer AndroidGraphicsConverter.createBox(createBox).

fun ImmutableBox.Companion.from(rect: MutableRect): ImmutableBox?

If rect is not empty, returns an ImmutableBox constructed from the values of rect. Otherwise returns null.

Performance-sensitive code should use the BoxAccumulator.add overload and obtain the bounding box from there, so that instance can be reused across multiple calls.

fun ImmutableBox.Companion.from(rect: Rect): ImmutableBox?

If rect is not empty, returns an ImmutableBox constructed from the values of rect. Otherwise returns null.

Performance-sensitive code should use the BoxAccumulator.add overload and obtain the bounding box from there, so that instance can be reused across multiple calls.