(&self, world: [f64; 2], camera: &crate::camera::Camera)
| 377 | bounds_h: 0, |
| 378 | bounds: Rectangle::default(), |
| 379 | scale_factor: 1.0, |
| 380 | } |
| 381 | } |
| 382 | |
| 383 | // Coordinate conversion helpers |
| 384 | fn screen_to_clip(&self, x: f32, y: f32) -> [f32; 2] { |
| 385 | let w = self.bounds_w.max(1) as f32; |
| 386 | let h = self.bounds_h.max(1) as f32; |
| 387 | [(x / w) * 2.0 - 1.0, 1.0 - (y / h) * 2.0] |
| 388 | } |
| 389 | |
| 390 | fn world_to_ndc(&self, world: [f64; 2], camera: &crate::camera::Camera) -> [f32; 2] { |
| 391 | let render_pos = [ |
| 392 | (world[0] - camera.render_offset.x) as f32, |
no test coverage detected