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

Method within_rect

bevy_plot2/src/canvas.rs:101–107  ·  view source on GitHub ↗
(&self, position: Vec2)

Source from the content-addressed store, hash-verified

99
100impl CanvasParams {
101 pub fn within_rect(&self, position: Vec2) -> bool {
102 let size = self.original_size * self.scale;
103 position.x < self.position.x + size.x / 2.0
104 && position.x > self.position.x - size.x / 2.0
105 && position.y < self.position.y + size.y / 2.0
106 && position.y > self.position.y - size.y / 2.0
107 }
108}
109
110#[derive(Resource, Default)]

Callers 4

update_canvas_mouse_posFunction · 0.45
pan_canvas_systemFunction · 0.45
zoom_canvas_systemFunction · 0.45
update_timeFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected