Format map_loader.rs

This commit is contained in:
codetiger
2026-01-06 21:20:15 +05:30
parent 3e78199709
commit 2c635ea183
+2 -1
View File
@@ -155,7 +155,8 @@ impl SimulationMap {
pub fn pixel_to_world(&self, px: u32, py: u32) -> (f32, f32) {
let x = self.origin.0 + (px as f32 + 0.5) * self.resolution;
// Y is inverted: bottom of image = origin, top of image = +Y
let y = self.origin.1 + (self.pixels.height() as f32 - 1.0 - py as f32 + 0.5) * self.resolution;
let y =
self.origin.1 + (self.pixels.height() as f32 - 1.0 - py as f32 + 0.5) * self.resolution;
(x, y)
}