Camera for viewing the plot in world-space. Manages the viewport transformation between world coordinates (data space), render coordinates, and screen coordinates. Supports panning and zooming.
| 49 | /// Manages the viewport transformation between world coordinates (data space), |
| 50 | /// render coordinates, and screen coordinates. Supports panning and zooming. |
| 51 | pub(crate) struct Camera { |
| 52 | /// Center position (world units) |
| 53 | pub position: DVec2, |
| 54 | /// Half extents in world units. |
| 55 | pub half_extents: DVec2, |
| 56 | /// Offset subtracted from world coordinates before rendering (for precision) |
| 57 | pub render_offset: DVec2, |
| 58 | } |
| 59 | |
| 60 | impl Camera { |
| 61 | pub(crate) fn new(width: u32, height: u32) -> Self { |
nothing calls this directly
no outgoing calls
no test coverage detected