setzer22 / egui_node_graph

Build your node graph applications in Rust, using egui
MIT License
711 stars 132 forks source link

feat: migrate to egui 0.24 #111

Open SergioRibera opened 7 months ago

SergioRibera commented 7 months ago

I updated egui to the latest version and also added the example in the workspace ignore since it is not really necessary to bring it to a library release

Resonanz commented 5 months ago

These fixes also seem to work for eframe and egui 0.25.0.

SergioRibera commented 5 months ago

These fixes also seem to work for eframe and egui 0.25.0.

Incredible, I had not seen that there is another version, as soon as I have time I will update the PR :D

michaeljones commented 5 months ago

From what I can tell (though this is my first attempt to do anything with egui), the example code does not work with egui 0.26. With 0.25, then a right-click opens the node finder but if I change to 0.26 then the right-click does nothing. From a quick print statement it seems that cursor_in_editor:

https://github.com/setzer22/egui_node_graph/blob/3068b8cd9bad3a419682af273c01cd700bda2739/egui_node_graph/src/editor_ui.rs#L125

is false for those clicks in 0.26 but true in 0.25. I don't know why. I can't see anything in the changelog that would necessary line up with this: https://github.com/emilk/egui/blob/master/CHANGELOG.md#0260---2024-02-05---text-selection-in-labels

Edit: From what I can tell it doesn't work with 0.26.1 either.

leongor commented 4 months ago

I've tried with 0.26.2 to remove && cursor_in_editor from this line: https://github.com/setzer22/egui_node_graph/blob/3068b8cd9bad3a419682af273c01cd700bda2739/egui_node_graph/src/editor_ui.rs#L411 Now right click partially works, but only when you drag and release, while click and release still doesn't work!

leongor commented 4 months ago

What fixed it for me additionally to removing cursor_in_editor is replacing this line: https://github.com/setzer22/egui_node_graph/blob/3068b8cd9bad3a419682af273c01cd700bda2739/egui_node_graph/src/editor_ui.rs#L424 with

        if mouse.any_pressed() && !cursor_in_finder {