Skip to main content

local_density

Function local_density 

Source
pub fn local_density() -> CompositionLocal<Density>
Expand description

The CompositionLocal carrying the device pixel grid.

Compose’s LocalDensity. Its default is whatever grid the host installed on this shell, so an application that never provides one still measures against the real screen; providing one scopes a different grid to a subtree, which is what a preview, a scaled container or a density-specific golden needs.