Skip to main content

Module units

Module units 

Source
Expand description

Pixel units and the checked numbers that go with them.

Logical pixels are what layout and the semantic tree use. Physical pixels are what a frame holds. The only way from one to the other is through a ScaleFactor, so a value in the wrong unit does not compile.

Structs§

InvalidRatio
A ratio that is not finite or lies outside 0 to 1.
InvalidScaleFactor
A scale factor that is not finite or lies outside 0.5 to 4.0.
Logical
A value in logical pixels.
Physical
A value in physical pixels. Made by multiplying a Logical value by a ScaleFactor, or with Physical::new where a value really is physical.
Ratio
A number from 0 to 1 inclusive, such as a diff threshold, so that a percentage cannot be passed by mistake.
ScaleFactor
The ratio of physical to logical pixels: finite and from 0.5 to 4.0.

Traits§

Scalable
Values that a ScaleFactor can scale between logical and physical pixels. Sealed.