pub struct NodeGraphViewState {
pub pan: CanvasPoint,
pub zoom: f32,
pub selected_nodes: Vec<NodeId>,
pub selected_edges: Vec<EdgeId>,
pub selected_groups: Vec<GroupId>,
pub draw_order: Vec<NodeId>,
pub edge_draw_order: Vec<EdgeId>,
pub group_draw_order: Vec<GroupId>,
}Expand description
Node graph editor view-state.
This is intentionally separate from graph semantics and may be stored per-user/per-project.
Fields§
§pan: CanvasPointCanvas pan in graph space.
zoom: f32Zoom factor.
selected_nodes: Vec<NodeId>Selected nodes (optional).
selected_edges: Vec<EdgeId>Selected edges (optional).
selected_groups: Vec<GroupId>Selected groups (optional).
draw_order: Vec<NodeId>Explicit draw order (optional).
edge_draw_order: Vec<EdgeId>Explicit edge draw order (optional).
group_draw_order: Vec<GroupId>Explicit group draw order (optional).
Implementations§
Source§impl NodeGraphViewState
impl NodeGraphViewState
pub fn set_viewport(&mut self, pan: CanvasPoint, zoom: f32)
pub fn set_selection( &mut self, nodes: Vec<NodeId>, edges: Vec<EdgeId>, groups: Vec<GroupId>, )
Sourcepub fn sanitize_for_graph(&mut self, graph: &Graph)
pub fn sanitize_for_graph(&mut self, graph: &Graph)
Removes stale IDs (selection / draw order) that no longer exist in the target graph.
pub fn sanitize_viewport(&mut self)
Trait Implementations§
Source§impl Clone for NodeGraphViewState
impl Clone for NodeGraphViewState
Source§fn clone(&self) -> NodeGraphViewState
fn clone(&self) -> NodeGraphViewState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NodeGraphViewState
impl Debug for NodeGraphViewState
Source§impl Default for NodeGraphViewState
impl Default for NodeGraphViewState
Source§impl<'de> Deserialize<'de> for NodeGraphViewState
impl<'de> Deserialize<'de> for NodeGraphViewState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&NodeGraphViewState> for NodeGraphPureViewState
impl From<&NodeGraphViewState> for NodeGraphPureViewState
Source§fn from(value: &NodeGraphViewState) -> Self
fn from(value: &NodeGraphViewState) -> Self
Converts to this type from the input type.
Source§impl From<NodeGraphPureViewState> for NodeGraphViewState
impl From<NodeGraphPureViewState> for NodeGraphViewState
Source§fn from(value: NodeGraphPureViewState) -> Self
fn from(value: NodeGraphPureViewState) -> Self
Converts to this type from the input type.
Source§impl From<NodeGraphViewState> for NodeGraphPureViewState
impl From<NodeGraphViewState> for NodeGraphPureViewState
Source§fn from(value: NodeGraphViewState) -> Self
fn from(value: NodeGraphViewState) -> Self
Converts to this type from the input type.
Source§impl PartialEq for NodeGraphViewState
impl PartialEq for NodeGraphViewState
Source§fn eq(&self, other: &NodeGraphViewState) -> bool
fn eq(&self, other: &NodeGraphViewState) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for NodeGraphViewState
impl Serialize for NodeGraphViewState
impl StructuralPartialEq for NodeGraphViewState
Auto Trait Implementations§
impl Freeze for NodeGraphViewState
impl RefUnwindSafe for NodeGraphViewState
impl Send for NodeGraphViewState
impl Sync for NodeGraphViewState
impl Unpin for NodeGraphViewState
impl UnsafeUnpin for NodeGraphViewState
impl UnwindSafe for NodeGraphViewState
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