From 1930d69ae37bb08a4d10b70e50ef9761c8544155 Mon Sep 17 00:00:00 2001 From: Konkitoman Date: Tue, 26 Sep 2023 20:34:09 +0300 Subject: [PATCH] Fix the change that change from a Vec to HashMap braked web and pure_glow --- crates/eframe/src/web/app_runner.rs | 2 +- crates/egui_glow/src/winit.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/eframe/src/web/app_runner.rs b/crates/eframe/src/web/app_runner.rs index 6f6ed20d4..76028ecdc 100644 --- a/crates/eframe/src/web/app_runner.rs +++ b/crates/eframe/src/web/app_runner.rs @@ -203,7 +203,7 @@ impl AppRunner { self.frame.info.cpu_usage = Some((now_sec() - frame_start) as f32); - let (_, repaint_after) = repaint_after[0]; + let repaint_after = repaint_after[&egui::ViewportId::MAIN]; (repaint_after, clipped_primitives) } diff --git a/crates/egui_glow/src/winit.rs b/crates/egui_glow/src/winit.rs index ced460ba0..50b9c9aa4 100644 --- a/crates/egui_glow/src/winit.rs +++ b/crates/egui_glow/src/winit.rs @@ -62,7 +62,10 @@ impl EguiGlow { self.shapes = shapes; self.textures_delta.append(textures_delta); - repaint_after.last().map(|(_, t)| *t).unwrap_or_default() + repaint_after + .get(&egui::ViewportId::MAIN) + .cloned() + .unwrap_or_default() } /// Paint the results of the last call to [`Self::run`].