x_graphics/base.rs
1use cfg_if::cfg_if;
2
3use crate::geometry::{FSize, ISize};
4
5cfg_if! {
6 if #[cfg(all(target_pointer_width = "64", any(target_os = "macos", target_os = "ios")))] {
7 pub type Float = f64;
8 } else if #[cfg(target_family = "wasm")] {
9 pub type Float = f64;
10 } else {
11 pub type Float = f32;
12 }
13}
14
15pub trait Dimension {
16 fn size(&self) -> FSize;
17 fn pixel_size(&self) -> ISize;
18}