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

Function plot_x_domain

src/plot_state.rs:942–959  ·  view source on GitHub ↗
(
    widget: &PlotWidget,
    data_min: Option<DVec2>,
    data_max: Option<DVec2>,
)

Source from the content-addressed store, hash-verified

940 if zoom_x {
941 self.camera.position.x += render_delta.x;
942 }
943 if zoom_y {
944 self.camera.position.y += render_delta.y;
945 }
946 self.update_axis_links();
947 }
948
949 fn pan_by(&mut self, direction: PanDirection, fraction: f64) {
950 let delta = self.camera.half_extents * (2.0 * fraction);
951 let pan_delta = match direction {
952 PanDirection::Left => DVec2::new(-delta.x, 0.0),
953 PanDirection::Right => DVec2::new(delta.x, 0.0),
954 PanDirection::Up => DVec2::new(0.0, delta.y),
955 PanDirection::Down => DVec2::new(0.0, -delta.y),
956 };
957
958 self.camera.position += pan_delta;
959 self.update_axis_links();
960 }
961
962 fn cursor_world_data(&self, viewport: DVec2) -> Option<[f64; 2]> {

Callers 1

rebuild_from_widgetMethod · 0.85

Calls 1

data_to_plotMethod · 0.80

Tested by

no test coverage detected