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

Method world_per_pixel

src/plot_renderer/shader.rs:405–410  ·  view source on GitHub ↗
(&self, camera: &crate::camera::Camera)

Source from the content-addressed store, hash-verified

403 let w = self.bounds_w.max(1) as f32;
404 let h = self.bounds_h.max(1) as f32;
405 (2.0 * pixels / w, 2.0 * pixels / h)
406 }
407
408 // Helper to convert world position to render position (subtract offset)
409 fn world_to_render_pos(&self, world: [f64; 2], camera: &crate::camera::Camera) -> [f32; 2] {
410 [
411 (world[0] - camera.render_offset.x) as f32,
412 (world[1] - camera.render_offset.y) as f32,
413 ]

Callers 1

rebuild_reflinesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected