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

Method pixels_to_clip_delta

src/plot_renderer/shader.rs:391–395  ·  view source on GitHub ↗
(&self, pixels: f32)

Source from the content-addressed store, hash-verified

389
390 fn world_to_ndc(&self, world: [f64; 2], camera: &crate::camera::Camera) -> [f32; 2] {
391 let render_pos = [
392 (world[0] - camera.render_offset.x) as f32,
393 (world[1] - camera.render_offset.y) as f32,
394 ];
395 let ndc_x =
396 (render_pos[0] - camera.effective_position().x as f32) / camera.half_extents.x as f32;
397 let ndc_y =
398 (render_pos[1] - camera.effective_position().y as f32) / camera.half_extents.y as f32;

Callers 1

rebuild_highlightMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected