MutableRect

Function

Common
fun MutableRect(offset: Offset, size: Size): MutableRect

Construct a rectangle from its left and top edges as well as its width and height.

Parameters

offsetOffset to represent the top and left parameters of the Rect
sizeSize to determine the width and height of this Rect.

Returns

Rect with Rect.left and Rect.top configured to Offset.x and Offset.y as Rect.right and Rect.bottom to Offset.x + Size.width and Offset.y + Size.height respectively
Common
fun MutableRect(topLeft: Offset, bottomRight: Offset): MutableRect

Construct the smallest rectangle that encloses the given offsets, treating them as vectors from the origin.

Parameters

topLeftOffset representing the left and top edges of the rectangle
bottomRightOffset representing the bottom and right edges of the rectangle
Common
fun MutableRect(center: Offset, radius: Float): MutableRect

Construct a rectangle that bounds the given circle

Parameters

centerOffset that represents the center of the circle
radiusRadius of the circle to enclose