ImmutableBox.Companion


public static class ImmutableBox.Companion


Summary

Public methods

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.

static final @NonNull ImmutableBox
fromTwoPoints(@NonNull Vec point1, @NonNull Vec point2)

Constructs the smallest ImmutableBox containing the two given points.

Extension functions

static final ImmutableBox

Constructs an ImmutableBox with the values from rect.

Public methods

fromCenterAndDimensions

Added in 1.0.0-alpha05
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

Added in 1.0.0-alpha05
public static final @NonNull ImmutableBox fromTwoPoints(@NonNull Vec point1, @NonNull Vec point2)

Constructs the smallest ImmutableBox containing the two given points.

Extension functions

AndroidGraphicsConverter.from

public static final ImmutableBox AndroidGraphicsConverter.from(
    @NonNull ImmutableBox.Companion receiver,
    @NonNull RectF rect
)

Constructs an ImmutableBox with the values from rect.

If rect is empty, returns null instead.

Java callers should prefer AndroidGraphicsConverter.createBox(createBox).