Module zng_layout::unit
source · Expand description
Angle, factor, length, time, byte and resolution units.
Modules§
- A collection of strongly typed math tools for computer graphics with an inclination towards 2d graphics and layout.
Structs§
x
andy
alignment.- Angle in degrees.
- Angle in gradians.
- Angle in radians.
- Angle in turns (complete rotations).
- A 2d vector of booleans, useful for component-wise logic operations.
- A length in bytes.
- Ellipses that define the radius of the four corners of a 2D box.
- Device independent pixel.
- Comparable key that represents the absolute distance between two pixel points.
- Normalized multiplication factor.
- Scale factor applied to x and y dimensions.
- Multiplication factor in percentage (0%-100%).
- Scale factor applied to margins.
- Spacing in-between grid cells in
Length
units. - 2D line in
Length
units. - 2D point in
Length
units. - Pixels-per-inch resolution.
- Pixels-per-meter resolution.
- Device pixel.
- Pixel length constraints.
- Pixel size constraints.
- Computed
GridSpacing
. - Computed
Line
. - 2D rect in
Length
units. - RGB + alpha.
- Color functions argument conversion helper.
- 2D size offsets in
Length
units. - A group of 2D side offsets, which correspond to top/right/bottom/left for borders, padding, and margins in CSS, optionally tagged with a unit.
- 2D size in
Length
units. - A transform builder type.
- 2D vector in
Length
units.
Enums§
- Represents a layout dimension.
- 1D length units.
- Represents an unresolved
Length
expression. - Orientation of two 2D items.
- A transform in device pixels.
Constants§
- Minimal difference between values in around the 0.0..=1.0 scale.
- Minimal difference between values in around the 1.0..=100.0 scale.
Traits§
- Extension methods for initializing angle units.
- Extension methods for initializing
ByteLength
values. - Extension methods for initializing factor units.
- Represents a one-dimensional length value that can be converted to a pixel length in a
LAYOUT
context. - Represents a two-dimensional value that can be converted to a pixel value in a
LAYOUT
context. - Extension methods for initializing
Length
units. - Build a
Line
using the syntax(x1, y1).to(x2, y2)
. - Build a
Rect
using the syntax(width, height).at(x, y)
. - Extension methods for initializing resolution units.
- Extension methods for initializing
Duration
values.
Functions§
f32
equality used in floating-point units.
Type Aliases§
- A rectangle box in device independent pixels.
- Corner-radius in device independent pixels.
- A point in device independent pixels.
- A rectangle in device independent pixels.
- Side-offsets in device independent pixels.
- A size in device pixels.
- A vector in device independent pixels.
- A rectangle box in device pixels.
- Corner-radius in device pixels.
- A point in device pixels.
- A rectangle in device pixels.
- Side-offsets in device pixels.
- A size in device pixels.
- A vector in device pixels.