MCPcopy Create free account
hub / github.com/donkeyteethUX/iced_plot / Camera

Class Camera

src/camera.rs:51–58  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

49/// Manages the viewport transformation between world coordinates (data space),
50/// render coordinates, and screen coordinates. Supports panning and zooming.
51pub(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
60impl Camera {
61 pub(crate) fn new(width: u32, height: u32) -> Self {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected