ContinuousRoundedCornerShape

class ContinuousRoundedCornerShape(topStart: CornerSize, topEnd: CornerSize, bottomEnd: CornerSize, bottomStart: CornerSize, smoothing: Float = 1.0f) : CornerBasedShape

A rounded-rectangle shape with continuous corners, like SwiftUI's RoundedRectangle(cornerRadius:style: .continuous).

A circular corner turns straight where its radius ends. A continuous corner keeps its radius but eases into each edge over a longer distance, about 1.53× the radius at full smoothing.

Pass it to GlassStyleScope.shape for Glass masking, refraction, lighting, and rim. Because it is a Compose shape, the same instance can be passed to Modifier.clip, Modifier.border, or an indication so that they match the Glass silhouette.

Compose's Interpolatable.lerp interpolates corners and smoothing between two continuous shapes. Corner units resolve at the actual size and density, and start/end corners follow layout direction. Finite fractions can overshoot: negative interpolated radii become zero and smoothing stays in 0f..1f. Other shape types follow Compose's normal interpolation dispatch. If neither shape supports the pair, Compose selects the first below 0.5f and the second otherwise.

Corner sizes resolve like RoundedCornerShape's. When a corner's eased extent would not fit along an edge, its smoothing is reduced, never its radius. A capsule, whose radius is half its shortest side, therefore draws circular ends, and a shape whose corners overlap, such as a leaf, draws circular corners.

Parameters

topStart

The top-start corner size.

topEnd

The top-end corner size.

bottomEnd

The bottom-end corner size.

bottomStart

The bottom-start corner size.

smoothing

How far corners ease into their edges: 0f is circular, matching RoundedCornerShape, and 1f, the default, is calibrated to look like SwiftUI's .continuous style. Finite values outside 0f..1f, such as animation overshoot, are coerced into that range.

Throws

Constructors

Link copied to clipboard
constructor(topStart: CornerSize, topEnd: CornerSize, bottomEnd: CornerSize, bottomStart: CornerSize, smoothing: Float = 1.0f)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

How far corners ease into their edges, in 0f..1f: 0f is circular.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns a copy of this shape with smoothing, keeping its corner sizes.

open override fun copy(topStart: CornerSize, topEnd: CornerSize, bottomEnd: CornerSize, bottomStart: CornerSize): ContinuousRoundedCornerShape

Returns a copy of this shape with new corner sizes, keeping its smoothing.

Link copied to clipboard
override fun createOutline(size: Size, layoutDirection: LayoutDirection, density: Density): Outline

open override fun createOutline(size: Size, topStart: Float, topEnd: Float, bottomEnd: Float, bottomStart: Float, layoutDirection: LayoutDirection): Outline

Creates the outline for already-resolved corner sizes: a rectangle when every corner is square, a rounded rectangle when every effective corner is circular, and otherwise a continuous path.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Whether other is a ContinuousRoundedCornerShape with equal corner sizes and smoothing.

Link copied to clipboard
open override fun hashCode(): Int

A hash code consistent with equals.

Link copied to clipboard
open override fun lerp(other: Any?, t: Float): ContinuousRoundedCornerShape?

Interpolates with another continuous shape, or returns null for another type.

Link copied to clipboard
open override fun toString(): String

Describes the corner sizes and smoothing.