-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething is brokenSomething is broken
Milestone
Description
The widget id used for the interact/response of Ui
is currently Ui::id
, which has a problem: is not necessarily unique.
We should instead use an Id
that is globally unique, i.e. based on where in the hierarchy the Ui
is, i.e. based on next_auto_id_salt
. I believe this means we need to store this in Ui
so we can use the same Id
in remember_min_rect
.
To see the problem with the current code, just apply this diff:
--- a/crates/egui_demo_lib/src/demo/interactive_container.rs
+++ b/crates/egui_demo_lib/src/demo/interactive_container.rs
@@ -21,6 +21,7 @@ impl crate::Demo for InteractiveContainerDemo {
.show(ctx, |ui| {
use crate::View as _;
self.ui(ui);
+ self.ui(ui);
});
}
}
This also means the drag-and-drop demo uses the same Id
for all drag-sources, which exsasserbates
Metadata
Metadata
Assignees
Labels
bugSomething is brokenSomething is broken