Add selection subtracting to the node graph view (#3290)
Add selection subtracting for node graph
This commit is contained in:
parent
3871b6c4cf
commit
94414adaf8
|
|
@ -969,7 +969,7 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
|
|||
}
|
||||
|
||||
// Clicked on the graph background so we box select
|
||||
if !shift_click {
|
||||
if !shift_click && !alt_click {
|
||||
responses.add(NodeGraphMessage::SelectedNodesSet { nodes: Vec::new() })
|
||||
}
|
||||
self.box_selection_start = Some((node_graph_point, false));
|
||||
|
|
@ -1925,12 +1925,13 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
|
|||
.transform_point2(ipp.mouse.position);
|
||||
|
||||
let shift = ipp.keyboard.get(Key::Shift as usize);
|
||||
let alt = ipp.keyboard.get(Key::Alt as usize);
|
||||
let Some(selected_nodes) = network_interface.selected_nodes_in_nested_network(selection_network_path) else {
|
||||
log::error!("Could not get selected nodes in UpdateBoxSelection");
|
||||
return;
|
||||
};
|
||||
let previous_selection = selected_nodes.selected_nodes_ref().iter().cloned().collect::<HashSet<_>>();
|
||||
let mut nodes = if shift {
|
||||
let mut nodes = if shift || alt {
|
||||
selected_nodes.selected_nodes_ref().iter().cloned().collect::<HashSet<_>>()
|
||||
} else {
|
||||
HashSet::new()
|
||||
|
|
@ -1943,7 +1944,11 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
|
|||
};
|
||||
let quad = Quad::from_box([box_selection_start, box_selection_end_graph]);
|
||||
if click_targets.node_click_target.intersect_path(|| quad.to_lines(), DAffine2::IDENTITY) {
|
||||
nodes.insert(node_id);
|
||||
if alt {
|
||||
nodes.remove(&node_id);
|
||||
} else {
|
||||
nodes.insert(node_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
if nodes != previous_selection {
|
||||
|
|
@ -2738,7 +2743,11 @@ impl NodeGraphMessageHandler {
|
|||
let mut hint_data = HintData(vec![
|
||||
HintGroup(vec![HintInfo::mouse(MouseMotion::Rmb, "Add Node")]),
|
||||
HintGroup(vec![HintInfo::mouse(MouseMotion::Lmb, "Select Node"), HintInfo::keys([Key::Shift], "Extend").prepend_plus()]),
|
||||
HintGroup(vec![HintInfo::mouse(MouseMotion::LmbDrag, "Select Area"), HintInfo::keys([Key::Shift], "Extend").prepend_plus()]),
|
||||
HintGroup(vec![
|
||||
HintInfo::mouse(MouseMotion::LmbDrag, "Select Area"),
|
||||
HintInfo::keys([Key::Shift], "Extend").prepend_plus(),
|
||||
HintInfo::keys([Key::Alt], "Subtract").prepend_plus(),
|
||||
]),
|
||||
]);
|
||||
if self.has_selection {
|
||||
hint_data.0.extend([
|
||||
|
|
|
|||
Loading…
Reference in New Issue