pub struct NodeEditorView {Show 13 fields
pub offset: Vec2,
pub zoom: f32,
pub canvas_size: Vec2,
pub selection_rect: Option<[Vec2; 2]>,
pub active_action: NodeEditorAction,
pub hovered_node: Option<u32>,
pub hovered_port: Option<(u32, u32)>,
pub pending_connection: Option<(u32, u32)>,
pub show_minimap: bool,
pub show_grid: bool,
pub snap_to_grid: bool,
pub grid_size: f32,
pub minimap_rect: [Vec2; 2],
}Fields§
§offset: Vec2§zoom: f32§canvas_size: Vec2§selection_rect: Option<[Vec2; 2]>§active_action: NodeEditorAction§hovered_node: Option<u32>§hovered_port: Option<(u32, u32)>§pending_connection: Option<(u32, u32)>§show_minimap: bool§show_grid: bool§snap_to_grid: bool§grid_size: f32§minimap_rect: [Vec2; 2]Implementations§
Source§impl NodeEditorView
impl NodeEditorView
pub fn new(canvas_size: Vec2) -> Self
pub fn screen_to_canvas(&self, screen: Vec2) -> Vec2
pub fn canvas_to_screen(&self, canvas: Vec2) -> Vec2
pub fn zoom_at(&mut self, screen_pivot: Vec2, factor: f32)
pub fn pan(&mut self, delta: Vec2)
pub fn fit_to_graph(&mut self, graph: &NodeGraph)
pub fn snap_position(&self, pos: Vec2) -> Vec2
pub fn nodes_in_selection(&self, graph: &NodeGraph) -> Vec<u32>
pub fn cubic_bezier_connection(from: Vec2, to: Vec2) -> [Vec2; 4]
Trait Implementations§
Source§impl Clone for NodeEditorView
impl Clone for NodeEditorView
Auto Trait Implementations§
impl Freeze for NodeEditorView
impl RefUnwindSafe for NodeEditorView
impl Send for NodeEditorView
impl Sync for NodeEditorView
impl Unpin for NodeEditorView
impl UnsafeUnpin for NodeEditorView
impl UnwindSafe for NodeEditorView
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.