summaryrefslogtreecommitdiff
path: root/racer-tracer/src/image.rs
blob: 1b5f61eafe36c5964751fc6cd7cc3d7a20f7c9b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[derive(Clone)]
pub struct Image {
    pub aspect_ratio: f64,
    pub width: usize,
    pub height: usize,
}

impl Image {
    pub fn new(aspect_ratio: f64, width: usize) -> Image {
        Image {
            aspect_ratio,
            width,
            height: (width as f64 / aspect_ratio) as usize,
        }
    }
}