1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

CentralPanel: base id on the current viewport (#3593)

This means two `CentralPanel`s in different viewports get different ids,
avoiding id clashes
This commit is contained in:
Emil Ernerfeldt
2023-11-20 21:54:32 +01:00
committed by GitHub
parent 44ff29b012
commit 39271c3adf
3 changed files with 3 additions and 5 deletions

View File

@@ -1062,7 +1062,7 @@ impl CentralPanel {
) -> InnerResponse<R> {
let available_rect = ctx.available_rect();
let layer_id = LayerId::background();
let id = Id::new("central_panel");
let id = Id::new((ctx.viewport_id(), "central_panel"));
let clip_rect = ctx.screen_rect();
let mut panel_ui = Ui::new(ctx.clone(), layer_id, id, available_rect, clip_rect);