From b91610c7ee46c01fbf0a2b13c0d0b7fc3f99cd00 Mon Sep 17 00:00:00 2001 From: Setzer22 Date: Tue, 21 Jun 2022 11:07:18 +0200 Subject: [PATCH] Change button_released for secondary_down The code in the original PR was correct, but button_released is not available on egui 0.18 from crates.io, this commit moves back to the old behavior of using secondary_down instead. --- egui_node_graph/src/editor_ui.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/egui_node_graph/src/editor_ui.rs b/egui_node_graph/src/editor_ui.rs index 564aa5b..358d0f1 100644 --- a/egui_node_graph/src/editor_ui.rs +++ b/egui_node_graph/src/editor_ui.rs @@ -248,18 +248,15 @@ where self.connection_in_progress = None; } - if mouse.button_released(PointerButton::Secondary) && cursor_in_editor && !cursor_in_finder - { + if mouse.secondary_down() && cursor_in_editor && !cursor_in_finder { self.node_finder = Some(NodeFinder::new_at(cursor_pos)); } if ui.ctx().input().key_pressed(Key::Escape) { self.node_finder = None; } - if r.dragged() { - if ui.ctx().input().pointer.middle_down() { - self.pan_zoom.pan += ui.ctx().input().pointer.delta(); - } + if r.dragged() && ui.ctx().input().pointer.middle_down() { + self.pan_zoom.pan += ui.ctx().input().pointer.delta(); } // Deselect and deactivate finder if the editor backround is clicked,