pub fn clamp_to_scale_factor(val: f32, round_down: bool) -> f32
Expand description

Clamp scaling factor to a power of two.

This code comes from gecko gfx/thebes/gfxUtils.cpp with the following modification:

  • logs are taken in base 2 instead of base e.