MCPcopy Create free account
hub / github.com/eliotbo/bevy_plot / to_local

Method to_local

src/plot/plot.rs:992–994  ·  view source on GitHub ↗

Convert a point in plot coordinates to a point in world coordinates modulo the canvas position

(&self, v: Vec2)

Source from the content-addressed store, hash-verified

990
991 /// Convert a point in plot coordinates to a point in world coordinates modulo the canvas position
992 pub fn to_local(&self, v: Vec2) -> Vec2 {
993 self.zero_world + v * self.canvas_size / (self.bounds.up - self.bounds.lo) / (1.0 + self.outer_border.x)
994 }
995
996 /// Convert a point in world coordinates to a point in the graph coordinates.
997 pub fn world_to_plot(&self, v: Vec2) -> Vec2 {

Callers 8

compute_bounds_worldMethod · 0.80
update_allMethod · 0.80
update_targetFunction · 0.80
update_mouse_targetFunction · 0.80
plot_pointsFunction · 0.80
plot_fnFunction · 0.80
plot_fnFunction · 0.80
plot_segmentsFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected