Skip to main content

gegl/
rectangle.rs

1use std::fmt;
2
3use crate::Rectangle;
4
5impl Rectangle {
6    pub fn x(&self) -> i32 {
7        self.inner.x
8    }
9
10    pub fn y(&self) -> i32 {
11        self.inner.y
12    }
13
14    pub fn width(&self) -> i32 {
15        self.inner.width
16    }
17
18    pub fn height(&self) -> i32 {
19        self.inner.height
20    }
21}
22
23impl fmt::Debug for Rectangle {
24    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
25        f.debug_struct("Rectangle")
26            .field("x", &self.x())
27            .field("y", &self.y())
28            .field("width", &self.width())
29            .field("height", &self.height())
30            .finish()
31    }
32}