pub enum DeviceIndependentPixel {}
Expand description
A normalized “pixel” at the default resolution for the display.
Like the CSS “px” unit, the exact physical size of this unit may vary between devices, but it should approximate a device-independent reference length. This unit corresponds to Android’s “density-independent pixel” (dip), Mac OS X’s “point”, and Windows “device-independent pixel.”
The relationship between DevicePixel and DeviceIndependentPixel is defined by the OS. On most low-dpi screens, one DeviceIndependentPixel is equal to one DevicePixel. But on high-density screens it can be some larger number. For example, by default on Apple “retina” displays, one DeviceIndependentPixel equals two DevicePixels. On Android “MDPI” displays, one DeviceIndependentPixel equals 1.5 device pixels.
The ratio between DeviceIndependentPixel and DevicePixel for a given display be found by calling
servo::windowing::WindowMethods::hidpi_factor
.
Trait Implementations§
source§impl Clone for DeviceIndependentPixel
impl Clone for DeviceIndependentPixel
source§fn clone(&self) -> DeviceIndependentPixel
fn clone(&self) -> DeviceIndependentPixel
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more