Cover

data class Cover(val alignment: Alignment = Alignment.Center) : Fit

Preserve aspect ratio and scale the artboard so that its smaller dimension matches the corresponding dimension of the containing view.

If aspect ratios are not identical, this will clip the artboard on the larger dimension.

Parameters

alignment

The alignment of the artboard within the containing view. Defaults to Alignment.Center.

ℹ️ Only the axis opposite to the smaller dimension will be relevant. E.g. when the artboard's width (horizontal axis) is smaller, only top, center, or bottom (vertical axis) alignments are relevant.

Constructors

Link copied to clipboard
constructor(alignment: Alignment = Alignment.Center)

Properties

Link copied to clipboard
open override val alignment: Alignment
Link copied to clipboard
open val scaleFactor: Float = 1.0f

Default scale factor. Only relevant with Fit.Layout, but still passed when drawing or on pointer events.