pixelab_core/
area.rs

1#[derive(Clone, Copy, PartialEq, Debug)]
2pub struct Area {
3    pub width: u16,
4    pub height: u16,
5}
6impl Area {
7    pub fn new(width: u16, height: u16) -> Self {
8        Self { width, height }
9    }
10}
11impl Default for Area {
12    fn default() -> Self {
13        Self {
14            width: 0,
15            height: 0,
16        }
17    }
18}
19impl core::fmt::Display for Area {
20    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21        write!(f, "width: {} height: {}", self.width, self.height)
22    }
23}