MCPcopy Create free account
hub / github.com/emilk/egui_plot / pointer_coordinate

Method pointer_coordinate

egui_plot/src/plot.rs:1984–1990  ·  view source on GitHub ↗

The pointer position in plot coordinates. Independent of whether the pointer is in the plot area.

(&self)

Source from the content-addressed store, hash-verified

1982 /// The pointer position in plot coordinates. Independent of whether the
1983 /// pointer is in the plot area.
1984 pub fn pointer_coordinate(&self) -> Option<PlotPoint> {
1985 // We need to subtract the drag delta to keep in sync with the frame-delayed
1986 // screen transform:
1987 let last_pos = self.ctx().input(|i| i.pointer.latest_pos())? - self.response.drag_delta();
1988 let value = self.plot_from_screen(last_pos);
1989 Some(value)
1990 }
1991
1992 /// The pointer drag delta in plot coordinates.
1993 pub fn pointer_coordinate_drag_delta(&self) -> Vec2 {

Callers 2

show_plotMethod · 0.80

Calls 2

ctxMethod · 0.80
plot_from_screenMethod · 0.80

Tested by

no test coverage detected