Closed hakolao closed 1 year ago
Thanks for the PR, I've tested it against the project I'm working on.
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.
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 .patch
file as generated by git format-patch
, the .txt
extension is due to GitHub's attachment policy.)
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.
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.
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 (https://github.com/emilk/egui/pull/2959). I haven't found any other issues.
Thanks a lot @hakolao and @kamirr for taking care of this! :smile: I have tested the changes and I can't spot any UX issues on my end either. I'll have a quick look at the code and then we can merge this :+1:
Trying a fix here for #79
So, I'm pretty sure https://github.com/emilk/egui/pull/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.