Remove debug-assert triggered by `with_layer_id/dnd_drag_source` (#5191)

* Closes https://github.com/emilk/egui/issues/5178
This commit is contained in:
Emil Ernerfeldt 2024-09-30 13:19:53 +02:00 committed by GitHub
parent 679f6f57b1
commit db3dcaf447
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 5 deletions

View File

@ -2260,6 +2260,16 @@ impl Ui {
}
/// Redirect shapes to another paint layer.
///
/// ```
/// # use egui::{LayerId, Order, Id};
/// # egui::__run_test_ui(|ui| {
/// let layer_id = LayerId::new(Order::Tooltip, Id::new("my_floating_ui"));
/// ui.with_layer_id(layer_id, |ui| {
/// ui.label("This is now in a different layer");
/// });
/// # });
/// ```
pub fn with_layer_id<R>(
&mut self,
layer_id: LayerId,

View File

@ -139,11 +139,6 @@ impl WidgetRects {
// e.g. calling `response.interact(…)` to add more interaction.
let (idx_in_layer, existing) = entry.get_mut();
debug_assert!(
existing.layer_id == widget_rect.layer_id,
"Widget changed layer_id during the frame"
);
// Update it:
existing.rect = widget_rect.rect; // last wins
existing.interact_rect = widget_rect.interact_rect; // last wins