(&self, camera: &crate::camera::Camera)
| 403 | let w = self.bounds_w.max(1) as f32; |
| 404 | let h = self.bounds_h.max(1) as f32; |
| 405 | (2.0 * pixels / w, 2.0 * pixels / h) |
| 406 | } |
| 407 | |
| 408 | // Helper to convert world position to render position (subtract offset) |
| 409 | fn world_to_render_pos(&self, world: [f64; 2], camera: &crate::camera::Camera) -> [f32; 2] { |
| 410 | [ |
| 411 | (world[0] - camera.render_offset.x) as f32, |
| 412 | (world[1] - camera.render_offset.y) as f32, |
| 413 | ] |