Helper to convert world position to render position (subtract offset)
(&self, world: [f64; 2], camera: &crate::camera::Camera)
| 396 | (render_pos[0] - camera.effective_position().x as f32) / camera.half_extents.x as f32; |
| 397 | let ndc_y = |
| 398 | (render_pos[1] - camera.effective_position().y as f32) / camera.half_extents.y as f32; |
| 399 | [ndc_x, ndc_y] |
| 400 | } |
| 401 | |
| 402 | fn pixels_to_clip_delta(&self, pixels: f32) -> (f32, f32) { |
| 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 | } |
no outgoing calls
no test coverage detected