Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,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));
Expand Down Expand Up @@ -1921,12 +1921,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()
Expand All @@ -1939,7 +1940,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 {
Expand Down Expand Up @@ -2734,7 +2739,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(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if subtracting is the right terminology.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be, that's how the graphite select tool and the wider ecosystem terms it: https://www.google.com/search?q=subtract%20selection (though I believe Pinta uses the proper set vocabulary which is pretty neat)

]),
]);
if self.has_selection {
hint_data.0.extend([
Expand Down
Loading