-
Notifications
You must be signed in to change notification settings - Fork 137
Update to egui 0.21 & fix the interaction bug #85
Conversation
Thanks for the PR, I've tested it against the project I'm working on.
That is correct, after resizing a node you can still grab only grab it by the rectangle it was created with. Otherwise everything I've needed seems to work fine:
I needed some egui 0.21 features and this allowed me to drop my fork with them backported, so I'll be working off this PR for the time being. If I find any issues I'll leave a comment. |
Great @kamirr , if you can figure out a fix for the rect bounds, that would be great :) |
This patch does the trick: 0001-Update-interactable-node-area.txt (note that this is a Feel free to add it to this PR if you like it. tl;dr it stores the outer rect in memory after populating child_ui and then uses this value during the next frame. |
egui_node_graph/src/node_finder.rs
Outdated
|
||
let max_height = ui.input().screen_rect.height() * 0.5; | ||
let max_height = ui.input(|i| i.screen_rect.height()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the * 0.5
dropped intentionally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accidentally!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
I'll add those fixes |
Had no clue how to use the patch..., copied it... Thanks for the fix! |
One thing I’ve noticed is that after some use my program enters a state in which I cannot edit values in DragValues in nodes by keyboard (dragging works fine) and it’s persistent across restarts of the program, until I drop the saved state. Not yet sure if it’s a bug in egui, this PR or my shenanigans. Will update. |
Turned out to be a bug in egui (emilk/egui#2959). I haven't found any other issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good :) Changes are pretty straightforward so no objections on my end. And it looks like this closes #71!
Trying a fix here for #79
So, I'm pretty sure emilk/egui#2244 broke the movement etc. Because the hover interaction never takes place on the
responses
for areas covered by other widgets. You can see this by debugging the overlapping widgets with styles. Maybe there is some way to tweak the layers / order of widgets, but dunno. So the solution:allocate_rect
for the background. Before the nodes.ui.interact
before adding the contets.Perhaps there is a better fix,
and I'm not sure if this breaks the dynamic rect size of the widgets, but the example works.This could at least point someone more knowledgeable towards a better direction so we can update to newer egui.