🎉 Tile rendering system

This commit is contained in:
Aitor Moreno 2025-02-17 12:54:51 +01:00 committed by Alejandro Alonso
parent b727f2fe1f
commit 084816fb9f
17 changed files with 956 additions and 408 deletions

View file

@ -280,6 +280,14 @@ impl Bounds {
let m = self.transform_matrix().unwrap_or(Matrix::default());
m.scale_y() < 0.0
}
pub fn to_rect(&self) -> Rect {
let minx = self.nw.x.min(self.ne.x).min(self.sw.x).min(self.se.x);
let miny = self.nw.y.min(self.ne.y).min(self.sw.y).min(self.se.y);
let maxx = self.nw.x.max(self.ne.x).max(self.sw.x).max(self.se.x);
let maxy = self.nw.y.max(self.ne.y).max(self.sw.y).max(self.se.y);
Rect::from_ltrb(minx, miny, maxx, maxy)
}
}
#[derive(Debug, Clone, PartialEq)]