RRect

data class RRect
kotlin.Any
   ↳ androidx.ui.engine.geometry.RRect

An immutable rounded rectangle with custom radii for all four corners.

Summary

Public constructors

<init>(left: Float, top: Float, right: Float, bottom: Float, topLeftRadiusX: Float, topLeftRadiusY: Float, topRightRadiusX: Float, topRightRadiusY: Float, bottomRightRadiusX: Float, bottomRightRadiusY: Float, bottomLeftRadiusX: Float, bottomLeftRadiusY: Float)

An immutable rounded rectangle with custom radii for all four corners.

Public methods

Boolean
contains(point: Offset)

Whether the point specified by the given offset (which is assumed to be relative to the origin) lies inside the rounded rectangle.

RRect
deflate(delta: Float)

RRect
inflate(delta: Float)

String

Extension functions

From androidx.ui.engine.geometry
Radius

The bottom-left Radius.

Radius

The bottom-right Radius.

Offset

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

The rectangle that would be formed using the axis-aligned intersection of the sides of the rectangle, i.

Rect

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

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.

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

The biggest rectangle that is entirely inside the rounded rectangle and has the full height of the rounded rectangle.

Radius

The top-left Radius.

Radius

The top-right Radius.

Rect

The biggest rectangle that is entirely inside the rounded rectangle and has the full width of the rounded rectangle.

RRect

Properties

Float

The offset of the bottom edge of this rectangle from the y axis

Float

The bottom-left horizontal radius

Float

The bottom-left vertical radius

Float

The bottom-right horizontal radius

Float

The bottom-right vertical radius

Float

The distance between the top and bottom edges of this rectangle.

Float

The offset of the left edge of this rectangle from the x axis

Float

The offset of the right edge of this rectangle from the x axis

Float

The offset of the top edge of this rectangle from the y axis

Float

The top-left horizontal radius

Float

The top-left vertical radius

Float

The top-right horizontal radius

Float

The top-right vertical radius

Float

The distance between the left and right edges of this rectangle.

Companion properties

RRect

A rounded rectangle with all the values set to zero.

Extension properties

From androidx.ui.engine.geometry
Boolean

Whether this rounded rectangle would draw as a circle.

Boolean

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

Boolean

Whether this rounded rectangle encloses a non-zero area.

Boolean

Whether all coordinates of this rounded rectangle are finite.

Boolean

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

Boolean

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

Float

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

Float

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

Public constructors

<init>

RRect(
    left: Float,
    top: Float,
    right: Float,
    bottom: Float,
    topLeftRadiusX: Float,
    topLeftRadiusY: Float,
    topRightRadiusX: Float,
    topRightRadiusY: Float,
    bottomRightRadiusX: Float,
    bottomRightRadiusY: Float,
    bottomLeftRadiusX: Float,
    bottomLeftRadiusY: Float)

An immutable rounded rectangle with custom radii for all four corners.

Public methods

contains

fun contains(point: Offset): Boolean

Whether the point specified by the given offset (which is assumed to be relative to the origin) lies inside the rounded rectangle.

This method may allocate (and cache) a copy of the object with normalized radii the first time it is called on a particular RRect instance. When using this method, prefer to reuse existing RRects rather than recreating the object each time.

deflate

fun deflate(delta: Float): RRect

Deprecated.

inflate

fun inflate(delta: Float): RRect

Deprecated.

toString

fun toString(): String

Properties

bottom

val bottom: Float

The offset of the bottom edge of this rectangle from the y axis

bottomLeftRadiusX

val bottomLeftRadiusX: Float

The bottom-left horizontal radius

bottomLeftRadiusY

val bottomLeftRadiusY: Float

The bottom-left vertical radius

bottomRightRadiusX

val bottomRightRadiusX: Float

The bottom-right horizontal radius

bottomRightRadiusY

val bottomRightRadiusY: Float

The bottom-right vertical radius

height

val height: Float

The distance between the top and bottom edges of this rectangle.

left

val left: Float

The offset of the left edge of this rectangle from the x axis

right

val right: Float

The offset of the right edge of this rectangle from the x axis

top

val top: Float

The offset of the top edge of this rectangle from the y axis

topLeftRadiusX

val topLeftRadiusX: Float

The top-left horizontal radius

topLeftRadiusY

val topLeftRadiusY: Float

The top-left vertical radius

topRightRadiusX

val topRightRadiusX: Float

The top-right horizontal radius

topRightRadiusY

val topRightRadiusY: Float

The top-right vertical radius

width

val width: Float

The distance between the left and right edges of this rectangle.

Companion properties

Zero

@JvmStatic val Zero: RRect

A rounded rectangle with all the values set to zero.