oa::NodeCanvas

Node-graph canvas navigation and coordinate mapping. Caller-owned; passed to crate::ui::Ui::node_canvas_grid to render the background grid. Coordinate transforms are provided for callers that need to project node world positions into screen pixels. Donor: oa::NodeCanvas.

StRust public API

Declaration

pub struct NodeCanvas { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn set_view_size(&mut self, w: f32, h: f32) -> Result<()>
pub fn state(&self) -> &NodeCanvasState
pub fn world_to_screen(&self, world: [f32; 2]) -> [f32; 2]
pub fn screen_to_world(&self, screen: [f32; 2]) -> [f32; 2]
pub fn pan(&mut self, delta: [f32; 2])
fn clone(&self) -> NodeCanvas
fn fmt(&self, f: &mut Formatter<'_>) -> Result

Associated Functions

pub fn new() -> Self
fn default() -> NodeCanvas

Public Method Documentation

pub fn set_view_size(&mut self, w: f32, h: f32) -> Result<()>
No public source comment is attached to this declaration.
pub fn state( &self ) -> &NodeCanvasState
No public source comment is attached to this declaration.
pub fn world_to_screen( &self, world: [f32; 2] ) -> [f32; 2]
No public source comment is attached to this declaration.
pub fn screen_to_world( &self, screen: [f32; 2] ) -> [f32; 2]
No public source comment is attached to this declaration.
pub fn pan( &mut self, delta: [f32; 2] )
No public source comment is attached to this declaration.
fn clone( &self ) -> NodeCanvas
No public source comment is attached to this declaration.
fn fmt( &self, f: &mut Formatter<'_> ) -> Result
No public source comment is attached to this declaration.
pub fn new() -> Self
Set the canvas view size (called once when the viewport is known).
fn default() -> NodeCanvas
No public source comment is attached to this declaration.