Module math

Source
Expand description

Logical ↔ physical coordinate conversion and snapping.

§Examples

use ailloli_ui_core::math::{to_physical_f32, Scale};
assert_eq!(to_physical_f32(2.0, Scale::new(2.0)), 4.0);

DPI scaling and snapping between logical and physical pixels.

Re-exports§

pub use scale::snap_f32_to_physical_px;
pub use scale::snap_point_to_physical;
pub use scale::snap_rect_to_physical;
pub use scale::snap_size_to_physical;
pub use scale::to_logical_f32;
pub use scale::to_physical_f32;
pub use scale::PhysicalRectI32;
pub use scale::Scale;

Modules§

scale
Device-pixel ratios and logical-to-physical snapping helpers.