From 4790a64812ccd8c9b60f85d557bc24d8f96553ff Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 15 Nov 2023 16:49:21 +0100 Subject: [PATCH] Fix wasm build --- crates/eframe/src/web/app_runner.rs | 5 ++--- crates/egui/src/context.rs | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/eframe/src/web/app_runner.rs b/crates/eframe/src/web/app_runner.rs index 3eec201dd05..ac8e5456150 100644 --- a/crates/eframe/src/web/app_runner.rs +++ b/crates/eframe/src/web/app_runner.rs @@ -185,6 +185,7 @@ impl AppRunner { platform_output, textures_delta, shapes, + pixels_per_point, viewports, viewport_commands: _, // TODO(emilk): handle some of the commands, like setting the title and icon } = full_output; @@ -195,9 +196,7 @@ impl AppRunner { self.handle_platform_output(platform_output); self.textures_delta.append(textures_delta); - let clipped_primitives = self - .egui_ctx - .tessellate(shapes, self.egui_ctx.pixels_per_point()); + let clipped_primitives = self.egui_ctx.tessellate(shapes, pixels_per_point); { let app_output = self.frame.take_app_output(); diff --git a/crates/egui/src/context.rs b/crates/egui/src/context.rs index f963d952e5e..e8c80ed3d70 100644 --- a/crates/egui/src/context.rs +++ b/crates/egui/src/context.rs @@ -267,8 +267,6 @@ impl ContextImpl { viewport.frame_state.begin_frame(&viewport.input); - let pixels_per_point = viewport.input.pixels_per_point(); - // Ensure we register the background area so panels and background ui can catch clicks: let screen_rect = viewport.input.screen_rect(); self.memory.areas_mut().set_state( @@ -287,6 +285,7 @@ impl ContextImpl { use crate::frame_state::AccessKitFrameState; let id = crate::accesskit_root_id(); let mut builder = accesskit::NodeBuilder::new(accesskit::Role::Window); + let pixels_per_point = viewport.input.pixels_per_point(); builder.set_transform(accesskit::Affine::scale(pixels_per_point.into())); let mut node_builders = IdMap::default(); node_builders.insert(id, builder);