UiDp

value class UiDp(val value: Float) : Comparable<UiDp> (source)

Density-independent layout distance.

The logical value is retained in the VNode tree and is converted to pixels only by a renderer. Arithmetic does not clamp or validate finite values; callers that cross a rendering boundary must supply values accepted by the consuming API.

Constructors

Link copied to clipboard
constructor(value: Float)

Types

Link copied to clipboard
object Companion

Provides common density-independent distance values.

Properties

Link copied to clipboard

logical density-independent pixel value

Functions

Link copied to clipboard
open operator override fun compareTo(other: UiDp): Int

Compares this distance with other by their logical values.

Link copied to clipboard
operator fun div(divisor: Float): UiDp
operator fun div(divisor: Int): UiDp

Returns this distance divided by divisor using floating-point arithmetic.

Link copied to clipboard
operator fun minus(other: UiDp): UiDp

Returns this distance minus other.

Link copied to clipboard
operator fun plus(other: UiDp): UiDp

Returns the sum of this distance and other.

Link copied to clipboard
operator fun times(scale: Float): UiDp

Returns this distance multiplied by scale.