x-graphics 0.2.1

Graphics framework for X
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use cfg_if::cfg_if;

use crate::geometry::{FSize, ISize};

cfg_if! {
    if #[cfg(all(target_pointer_width = "64", any(target_os = "macos", target_os = "ios")))] {
        pub type Float = f64;
    } else if #[cfg(target_family = "wasm")] {
        pub type Float = f64;
    } else {
        pub type Float = f32;
    }
}

pub trait Dimension {
    fn size(&self) -> FSize;
    fn pixel_size(&self) -> ISize;
}