Google berkomitmen untuk mendorong terwujudnya keadilan rasial bagi komunitas Kulit Hitam. Lihat caranya.

# androidx.ui.geometry

## Interfaces

 OffsetBase Base class for Size and Offset, which are both ways to describe a distance as a two-dimensional axis-aligned vector.

## Classes

 Offset An immutable 2D floating-point offset. Radius A radius for either circular or elliptical shapes. Rect An immutable, 2D, axis-aligned, floating-point rectangle whose coordinates are relative to a given origin. RRect An immutable rounded rectangle with custom radii for all four corners. Size Holds a 2D floating-point size.

## Top-level functions summary

 Offset `Offset(x: Float, y: Float)` Constructs an Offset from the given relative x and y offsets RRect `RRect(left: Float, top: Float, right: Float, bottom: Float, radiusX: Float, radiusY: Float)` Construct a rounded rectangle from its left, top, right, and bottom edges, and the same radii along its horizontal axis and its vertical axis. RRect `RRect(left: Float, top: Float, right: Float, bottom: Float, radius: Radius)` Construct a rounded rectangle from its left, top, right, and bottom edges, and the same radius in each corner. RRect `RRect(rect: Rect, radiusX: Float, radiusY: Float)` Construct a rounded rectangle from its bounding box and the same radii along its horizontal axis and its vertical axis. RRect `RRect(rect: Rect, radius: Radius)` Construct a rounded rectangle from its bounding box and a radius that is the same in each corner. RRect `RRect(left: Float, top: Float, right: Float, bottom: Float, topLeft: Radius = Radius.Zero, topRight: Radius = Radius.Zero, bottomRight: Radius = Radius.Zero, bottomLeft: Radius = Radius.Zero)` Construct a rounded rectangle from its left, top, right, and bottom edges, and topLeft, topRight, bottomRight, and bottomLeft radii. RRect `RRect(rect: Rect, topLeft: Radius = Radius.Zero, topRight: Radius = Radius.Zero, bottomRight: Radius = Radius.Zero, bottomLeft: Radius = Radius.Zero)` Construct a rounded rectangle from its bounding box and and topLeft, topRight, bottomRight, and bottomLeft radii. Radius `Radius(x: Float, y: Float = x)` Constructs a Radius with the given x and y parameters for the size of the radius along the x and y axis respectively. Size `Size(width: Float, height: Float)` Constructs a Size from the given width and height Offset `lerp(start: Offset, stop: Offset, fraction: Float)` Linearly interpolate between two offsets. RRect `lerp(start: RRect, stop: RRect, fraction: Float)` Linearly interpolate between two rounded rectangles. Radius `lerp(start: Radius, stop: Radius, fraction: Float)` Linearly interpolate between two radii. Rect `lerp(start: Rect, stop: Rect, fraction: Float)` Linearly interpolate between two rectangles. Size? `lerp(start: Size, stop: Size, fraction: Float)` Linearly interpolate between two sizes

## Extension functions summary

 For kotlin.Double operator Size `Double.times(size: Size)` Returns a Size with size's Size.width and Size.height multiplied by this
 For kotlin.Float operator Size `Float.times(size: Size)` Returns a Size with size's Size.width and Size.height multiplied by this
 For kotlin.Int operator Size `Int.times(size: Size)` Returns a Size with size's Size.width and Size.height multiplied by this
 For RRect Radius `RRect.bottomLeftRadius()` The bottom-left Radius. Radius `RRect.bottomRightRadius()` The bottom-right Radius. Offset `RRect.center()` The offset to the point halfway between the left and right and the top and bottom edges of this rectangle. RRect `RRect.grow(delta: Float)` Returns a new RRect with edges and radii moved outwards by the given delta. Rect `RRect.middleRect()` The rectangle that would be formed using the axis-aligned intersection of the sides of the rectangle, i. Rect `RRect.outerRect()` The bounding box of this rounded rectangle (the rectangle with no rounded corners). Rect `RRect.safeInnerRect()` The non-rounded rectangle that is constrained by the smaller of the two diagonals, with each diagonal traveling through the middle of the curve corners. RRect `RRect.shift(offset: Offset)` Returns a new RRect translated by the given offset. RRect `RRect.shrink(delta: Float)` Returns a new RRect with edges and radii moved inwards by the given delta. Rect `RRect.tallMiddleRect()` The biggest rectangle that is entirely inside the rounded rectangle and has the full height of the rounded rectangle. Radius `RRect.topLeftRadius()` The top-left Radius. Radius `RRect.topRightRadius()` The top-right Radius. Rect `RRect.wideMiddleRect()` The biggest rectangle that is entirely inside the rounded rectangle and has the full width of the rounded rectangle. RRect `RRect.withRadius(radius: Radius)`
 For Size Rect `Size.toRect()` Convert a Size to a Rect.

## Extension properties summary

 For RRect Boolean `RRect.isCircle()` Whether this rounded rectangle would draw as a circle. Boolean `RRect.isEllipse()` Whether this rounded rectangle has no side with a straight section. Boolean `RRect.isEmpty()` Whether this rounded rectangle encloses a non-zero area. Boolean `RRect.isFinite()` Whether all coordinates of this rounded rectangle are finite. Boolean `RRect.isRect()` Whether this rounded rectangle is a simple rectangle with zero corner radii. Boolean `RRect.isSimple()` Returns `true` if the rounded rectangle have the same radii in both the horizontal and vertical direction for all corners. Boolean `RRect.isStadium()` Whether this rounded rectangle has a side with no straight section. Float `RRect.longestSide()` The greater of the magnitudes of the RRect.width and the RRect.height of this rounded rectangle. Float `RRect.shortestSide()` The lesser of the magnitudes of the RRect.width and the RRect.height of this rounded rectangle.

## Top-level functions

### Offset

`@Stable inline fun Offset(    x: Float,     y: Float): Offset`

Constructs an Offset from the given relative x and y offsets

### RRect

`fun RRect(    left: Float,     top: Float,     right: Float,     bottom: Float,     radiusX: Float,     radiusY: Float): RRect`

Construct a rounded rectangle from its left, top, right, and bottom edges, and the same radii along its horizontal axis and its vertical axis.

### RRect

`fun RRect(    left: Float,     top: Float,     right: Float,     bottom: Float,     radius: Radius): RRect`

Construct a rounded rectangle from its left, top, right, and bottom edges, and the same radius in each corner.

### RRect

`fun RRect(    rect: Rect,     radiusX: Float,     radiusY: Float): RRect`

Construct a rounded rectangle from its bounding box and the same radii along its horizontal axis and its vertical axis.

### RRect

`fun RRect(    rect: Rect,     radius: Radius): RRect`

Construct a rounded rectangle from its bounding box and a radius that is the same in each corner.

### RRect

`fun RRect(    left: Float,     top: Float,     right: Float,     bottom: Float,     topLeft: Radius = Radius.Zero,     topRight: Radius = Radius.Zero,     bottomRight: Radius = Radius.Zero,     bottomLeft: Radius = Radius.Zero): RRect`

Construct a rounded rectangle from its left, top, right, and bottom edges, and topLeft, topRight, bottomRight, and bottomLeft radii.

### RRect

`fun RRect(    rect: Rect,     topLeft: Radius = Radius.Zero,     topRight: Radius = Radius.Zero,     bottomRight: Radius = Radius.Zero,     bottomLeft: Radius = Radius.Zero): RRect`

Construct a rounded rectangle from its bounding box and and topLeft, topRight, bottomRight, and bottomLeft radii.

`@Stable inline fun Radius(    x: Float,     y: Float = x): Radius`

Constructs a Radius with the given x and y parameters for the size of the radius along the x and y axis respectively. By default the radius along the Y axis matches that of the given x-axis unless otherwise specified

### Size

`@Stable fun Size(    width: Float,     height: Float): Size`

Constructs a Size from the given width and height

### lerp

`@Stable fun lerp(    start: Offset,     stop: Offset,     fraction: Float): Offset`

Linearly interpolate between two offsets.

The fraction argument represents position on the timeline, with 0.0 meaning that the interpolation has not started, returning start (or something equivalent to start), 1.0 meaning that the interpolation has finished, returning stop (or something equivalent to stop), and values in between meaning that the interpolation is at the relevant point on the timeline between start and stop. The interpolation can be extrapolated beyond 0.0 and 1.0, so negative values and values greater than 1.0 are valid (and can easily be generated by curves).

Values for fraction are usually obtained from an Animation, such as an `AnimationController`.

### lerp

`fun lerp(    start: RRect,     stop: RRect,     fraction: Float): RRect`

Linearly interpolate between two rounded rectangles.

The fraction argument represents position on the timeline, with 0.0 meaning that the interpolation has not started, returning start (or something equivalent to start), 1.0 meaning that the interpolation has finished, returning stop (or something equivalent to stop), and values in between meaning that the interpolation is at the relevant point on the timeline between start and stop. The interpolation can be extrapolated beyond 0.0 and 1.0, so negative values and values greater than 1.0 are valid (and can easily be generated by curves).

Values for fraction are usually obtained from an Animation, such as an `AnimationController`.

### lerp

`@Stable fun lerp(    start: Radius,     stop: Radius,     fraction: Float): Radius`

The fraction argument represents position on the timeline, with 0.0 meaning that the interpolation has not started, returning start (or something equivalent to start), 1.0 meaning that the interpolation has finished, returning stop (or something equivalent to stop), and values in between meaning that the interpolation is at the relevant point on the timeline between start and stop. The interpolation can be extrapolated beyond 0.0 and 1.0, so negative values and values greater than 1.0 are valid (and can easily be generated by curves).

Values for fraction are usually obtained from an Animation, such as an `AnimationController`.

### lerp

`@Stable fun lerp(    start: Rect,     stop: Rect,     fraction: Float): Rect`

Linearly interpolate between two rectangles.

The fraction argument represents position on the timeline, with 0.0 meaning that the interpolation has not started, returning start (or something equivalent to start), 1.0 meaning that the interpolation has finished, returning stop (or something equivalent to stop), and values in between meaning that the interpolation is at the relevant point on the timeline between start and stop. The interpolation can be extrapolated beyond 0.0 and 1.0, so negative values and values greater than 1.0 are valid (and can easily be generated by curves).

Values for fraction are usually obtained from an Animation, such as an `AnimationController`.

### lerp

`@Stable fun lerp(    start: Size,     stop: Size,     fraction: Float): Size?`

Linearly interpolate between two sizes

The fraction argument represents position on the timeline, with 0.0 meaning that the interpolation has not started, returning start (or something equivalent to start), 1.0 meaning that the interpolation has finished, returning stop (or something equivalent to stop), and values in between meaning that the interpolation is at the relevant point on the timeline between start and stop. The interpolation can be extrapolated beyond 0.0 and 1.0, so negative values and values greater than 1.0 are valid (and can easily be generated by curves).

Values for fraction are usually obtained from an Animation, such as an `AnimationController`.

## Extension functions

`fun RRect.bottomLeftRadius(): Radius`

`fun RRect.bottomRightRadius(): Radius`

### center

`fun RRect.center(): Offset`

The offset to the point halfway between the left and right and the top and bottom edges of this rectangle.

### grow

`fun RRect.grow(delta: Float): RRect`

Returns a new RRect with edges and radii moved outwards by the given delta.

### middleRect

`fun RRect.middleRect(): Rect`

The rectangle that would be formed using the axis-aligned intersection of the sides of the rectangle, i.e., the rectangle formed from the inner-most centers of the ellipses that form the corners. This is the intersection of the wideMiddleRect and the tallMiddleRect. If any of the intersections are void, the resulting Rect will have negative width or height.

### outerRect

`fun RRect.outerRect(): Rect`

The bounding box of this rounded rectangle (the rectangle with no rounded corners).

### safeInnerRect

`fun RRect.safeInnerRect(): Rect`

The non-rounded rectangle that is constrained by the smaller of the two diagonals, with each diagonal traveling through the middle of the curve corners. The middle of a corner is the intersection of the curve with its respective quadrant bisector.

### shift

`fun RRect.shift(offset: Offset): RRect`

Returns a new RRect translated by the given offset.

### shrink

`fun RRect.shrink(delta: Float): RRect`

Returns a new RRect with edges and radii moved inwards by the given delta.

### tallMiddleRect

`fun RRect.tallMiddleRect(): Rect`

The biggest rectangle that is entirely inside the rounded rectangle and has the full height of the rounded rectangle. If the rounded rectangle does not have an axis-aligned intersection of its top and bottom side, the resulting Rect will have negative width or height.

### times

`@Stable inline operator fun Double.times(size: Size): Size`

Returns a Size with size's Size.width and Size.height multiplied by this

### times

`@Stable inline operator fun Float.times(size: Size): Size`

Returns a Size with size's Size.width and Size.height multiplied by this

### times

`@Stable inline operator fun Int.times(size: Size): Size`

Returns a Size with size's Size.width and Size.height multiplied by this

### toRect

`@Stable fun Size.toRect(): Rect`

Convert a Size to a Rect.

`fun RRect.topLeftRadius(): Radius`

`fun RRect.topRightRadius(): Radius`

### wideMiddleRect

`fun RRect.wideMiddleRect(): Rect`

The biggest rectangle that is entirely inside the rounded rectangle and has the full width of the rounded rectangle. If the rounded rectangle does not have an axis-aligned intersection of its left and right side, the resulting Rect will have negative width or height.

`fun RRect.withRadius(radius: Radius): RRect`

## Extension properties

### isCircle

`val RRect.isCircle: Boolean`

Whether this rounded rectangle would draw as a circle.

### isEllipse

`val RRect.isEllipse: Boolean`

Whether this rounded rectangle has no side with a straight section.

### isEmpty

`val RRect.isEmpty: Boolean`

Whether this rounded rectangle encloses a non-zero area. Negative areas are considered empty.

### isFinite

`val RRect.isFinite: Boolean`

Whether all coordinates of this rounded rectangle are finite.

### isRect

`val RRect.isRect: Boolean`

Whether this rounded rectangle is a simple rectangle with zero corner radii.

### isSimple

`val RRect.isSimple: Boolean`

Returns `true` if the rounded rectangle have the same radii in both the horizontal and vertical direction for all corners.

`val RRect.isStadium: Boolean`

Whether this rounded rectangle has a side with no straight section.

### longestSide

`val RRect.longestSide: Float`

The greater of the magnitudes of the RRect.width and the RRect.height of this rounded rectangle.

### shortestSide

`val RRect.shortestSide: Float`

The lesser of the magnitudes of the RRect.width and the RRect.height of this rounded rectangle.