mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
Fix holding Ctrl in the graph not allowing for selecting nodes unless some are in a layer (#3778)
* Fix * Fix-2 * Formatting --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
@@ -74,7 +74,7 @@ pub fn input_mappings(zoom_with_scroll: bool) -> Mapping {
|
||||
entry!(KeyDown(MouseLeft); modifiers=[Alt], action_dispatch=NodeGraphMessage::PointerDown { shift_click: false, control_click: false, alt_click: true, right_click: false }),
|
||||
entry!(KeyDown(MouseRight); action_dispatch=NodeGraphMessage::PointerDown { shift_click: false, control_click: false, alt_click: false, right_click: true }),
|
||||
entry!(DoubleClick(MouseButton::Left); action_dispatch=NodeGraphMessage::EnterNestedNetwork),
|
||||
entry!(PointerMove; refresh_keys=[Shift], action_dispatch=NodeGraphMessage::PointerMove { shift: Shift }),
|
||||
entry!(PointerMove; refresh_keys=[Control, Alt, Shift], action_dispatch=NodeGraphMessage::PointerMove { shift: Shift }),
|
||||
entry!(PointerShake; action_dispatch=NodeGraphMessage::ShakeNode),
|
||||
entry!(KeyUp(MouseLeft); action_dispatch=NodeGraphMessage::PointerUp),
|
||||
entry!(KeyDown(Delete); modifiers=[Accel], action_dispatch=NodeGraphMessage::DeleteSelectedNodes { delete_children: false }),
|
||||
|
||||
@@ -1977,16 +1977,8 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
|
||||
}
|
||||
|
||||
if control {
|
||||
let mut non_layer_nodes = HashSet::new();
|
||||
|
||||
let layer_nodes = nodes.iter().filter(|node_id| network_interface.is_layer(node_id, selection_network_path));
|
||||
for &layer_id in layer_nodes {
|
||||
for child_id in network_interface.upstream_flow_back_from_nodes(vec![layer_id], selection_network_path, FlowType::LayerChildrenUpstreamFlow) {
|
||||
if nodes.contains(&child_id) && child_id != layer_id {
|
||||
non_layer_nodes.insert(child_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
let layer_nodes: HashSet<_> = nodes.iter().filter(|node_id| network_interface.is_layer(node_id, selection_network_path)).cloned().collect();
|
||||
let non_layer_nodes: HashSet<_> = nodes.difference(&layer_nodes).cloned().collect();
|
||||
|
||||
// Remove non-layer nodes from selection
|
||||
if alt {
|
||||
|
||||
Reference in New Issue
Block a user