PlacementLayerScope

sealed interface PlacementLayerScope

The properties of the layer PlacementScope.placeWithLayer places a child with, which its layerBlock sets, as androidx's GraphicsLayerScope does for a graphics layer.

The layer covers the placed box: the size the child measured to where a MeasurePolicy places it, or the size the content reports where a layout modifier places it. What it paints past the layout bounds grows the component's paint outsets. A state read in the block repaints the component without measuring it again; where the paint outsets it takes resize a Foundation container, that container places its children again. Each run of the block starts from the defaults, so a property the block leaves unset paints at its default.

Under a Foundation container, mouse input reaches what a rotation or a scale paints under the pointer, at the point in the target's own coordinates. Tooltips and popups the content opens stand where they would stand without the layer.

Properties

Link copied to clipboard
abstract var alpha: Float

The opacity the content paints at, as one image: overlapping content inside it does not show through. 1f by default. A value above 1f paints at 1f; 0f, a value below it and NaN paint nothing.

Link copied to clipboard
abstract var clip: Boolean

Whether the content's painting is cut to the layer's box, inside every enclosing clipping layer; false by default.

Link copied to clipboard
abstract var rotationZ: Float

Rotation in degrees around transformOrigin, after scaling; positive is clockwise on screen. Default 0f.

Link copied to clipboard
abstract var scaleX: Float

The horizontal scale around transformOrigin; 1f by default, and 0f paints nothing.

Link copied to clipboard
abstract var scaleY: Float

The vertical scale around transformOrigin; 1f by default, and 0f paints nothing.

Link copied to clipboard

Shared pivot for scale and rotationZ, within the placed box; TransformOrigin.Center by default.