withCenterAt

public final static RectF withCenterAt(ImmutablePosition position, Float x, Float y)

Creates a Rect around a center position.

This is equal to:

val cx = position.x.
val cy = position.y
val rect = RectF(cx - x, cy - y, cx + x, cy + y)

Parameters

position

The central position.

x

The distance from the center position to the right and left side.

y

The distance from the center position to the top and bottom side.


public final static RectF withCenterAt(ImmutablePosition position, Float side)

Creates a Rect around a center position.

This is equal to:

val cx = position.x.
val cy = position.y
val rect = RectF(cx - side, cy - side, cx + side, cy + side)

Parameters

position

The central position.

side

The distance from the center position to each rect side.