pub enum GraphAction {
NodeMoved {
node: NodeId,
from: WorldPos,
to: WorldPos,
},
StackMoved {
stack: StackId,
from: WorldPos,
to: WorldPos,
},
StackMemberMoved {
stack: StackId,
from_index: usize,
to_index: usize,
},
SelectionChanged,
LinkRequested {
from: PortAddr,
to: PortAddr,
},
LinkDeleteRequested {
link: Link,
},
NodesDeleteRequested {
nodes: Vec<NodeId>,
},
StacksDeleteRequested {
stacks: Vec<StackId>,
},
StackAddRequested {
stack: StackId,
},
ContextMenu {
at: WorldPos,
},
LinkDropped {
source: PortAddr,
source_is_output: bool,
at: WorldPos,
},
}Expand description
A structural change the consumer may choose to apply.
Variants§
NodeMoved
A node finished being dragged to a new world position. from is its
position at grab time. (to is also already written into GraphView;
this lets the consumer react, e.g. record an undoable move.)
StackMoved
A stack finished being dragged (by its header) to a new world
position. from is its position at grab time; to is already written
into GraphView.
StackMemberMoved
A stack member was dragged to a new slot within its stack. The
member at from_index should move so it ends up at to_index
(i.e. remove at from_index, then insert at to_index).
SelectionChanged
The selection set changed this frame.
LinkRequested
The user dragged a new link from an output to an input port.
LinkDeleteRequested
The user requested deletion of an existing link.
NodesDeleteRequested
The user requested deletion of the given nodes (e.g. Delete key).
StacksDeleteRequested
The user requested deletion of the given stacks (e.g. Delete key while stacks are selected). The consumer decides what this means for its domain (e.g. emptying a fixed pipeline stage vs. removing the container).
StackAddRequested
The user clicked the “Add” button at the bottom of a stack, requesting a new member be appended to that stack (e.g. via a group-specific menu).
ContextMenu
The user requested a context menu at a world position (right-click on empty canvas).
LinkDropped
The user released an in-progress link drag over empty canvas. The
consumer may offer to create a node and wire it to source: an output
pin (when source_is_output) needing a consumer, or an input pin
awaiting a producer.
Trait Implementations§
Source§impl Clone for GraphAction
impl Clone for GraphAction
Source§fn clone(&self) -> GraphAction
fn clone(&self) -> GraphAction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more