Enum servo_geometry::DeviceIndependentPixel[][src]

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.