#[derive(Debug, Clone, PartialEq)]
pub struct GridPosition {
pub left: i32,
pub top: i32,
pub width: i32,
pub height: i32,
}
impl GridPosition {
pub fn with_left(mut self, left: i32) -> Self {
self.left = left;
self
}
pub fn with_top(mut self, top: i32) -> Self {
self.top = top;
self
}
pub fn with_width(mut self, width: i32) -> Self {
self.width = width;
self
}
pub fn with_height(mut self, height: i32) -> Self {
self.height = height;
self
}
}
impl Default for GridPosition {
fn default() -> Self {
Self {
left: 0,
top: 0,
width: 1,
height: 1,
}
}
}