BiasAlignment

@Immutable
data class BiasAlignment(val horizontalBias: Float, val verticalBias: Float) : Alignment

Places a child at a bias through the space it leaves free: -1 at the leading edge, 0 centered, 1 at the trailing edge, and any other value proportionally, which puts a bias outside -1..1 partly or wholly outside that space. A right-to-left orientation mirrors the horizontal bias.

Each offset is worked out as a float and rounded once, so the two halves of a centered child differ by at most one unit of user-space coordinates.

See also

Constructors

Link copied to clipboard
constructor(horizontalBias: Float, verticalBias: Float)

Types

Link copied to clipboard
@Immutable
data class Horizontal(val bias: Float) : Alignment.Horizontal

The horizontal half of a BiasAlignment; it is the one that reads the orientation.

Link copied to clipboard
@Immutable
data class Vertical(val bias: Float) : Alignment.Vertical

The vertical half of a BiasAlignment; a vertical axis reads the same either way.

Properties

Link copied to clipboard

The bias across the width available to the child.

Link copied to clipboard

The bias down the height available to the child.

Functions

Link copied to clipboard
open override fun align(size: Dimension, space: Dimension, orientation: ComponentOrientation): Point

The child's offset from the top left of space, for a child of extent size in a container laid out under orientation.