pub fn set_density(density: f32)
Updates the current density scale factor.
This triggers a global layout invalidation when the value changes because density impacts layout, text measurement, and input thresholds.