From 670880f686e6ac73c5ce454b6484cd08d7c33382 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 6 Nov 2026 22:59:50 -0800 Subject: [PATCH] Font menu: the wasm build has no unread wheel-field warnings The queued and replayed wheel events of the font menu are read only by native-only code (the viewport-layer plugin and the replay loop). Their fields that only that code reads (frame, menu, position, event and amount of QueuedWheel, and target of ReplayWheel) and the push that fills the queue now carry the same cfg(not(target_arch = "wasm32")) as their readers, so `cargo check --target wasm32-unknown-unknown -p vectorcraft-ui-egui` no longer warns that they are never read. Native builds do not change. --- crates/ui-egui/src/font_menu.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/ui-egui/src/font_menu.rs b/crates/ui-egui/src/font_menu.rs index 39dd49bfc..1896b8ed9 100644 --- a/crates/ui-egui/src/font_menu.rs +++ b/crates/ui-egui/src/font_menu.rs @@ -443,12 +443,17 @@ struct WheelField { #[derive(Clone)] struct QueuedWheel { + #[cfg(not(target_arch = "wasm32"))] frame: u64, field: egui::Id, + #[cfg(not(target_arch = "wasm32"))] menu: egui::Id, + #[cfg(not(target_arch = "wasm32"))] position: egui::Pos2, rect: egui::Rect, + #[cfg(not(target_arch = "wasm32"))] event: egui::Event, + #[cfg(not(target_arch = "wasm32"))] amount: f32, reset_after: bool, positions_after: Vec, @@ -456,6 +461,7 @@ struct QueuedWheel { #[derive(Clone)] struct ReplayWheel { + #[cfg(not(target_arch = "wasm32"))] target: egui::LayerId, position: egui::Pos2, event: egui::Event, @@ -791,6 +797,7 @@ pub(crate) fn take_raw_wheel(ctx: &egui::Context, raw: &mut egui::RawInput) { egui::MouseWheelUnit::Line | egui::MouseWheelUnit::Page => delta.y, }; if cfg!(not(target_arch = "wasm32")) && ctx.viewport_id() != raw.viewport_id { + #[cfg(not(target_arch = "wasm32"))] if let Some(position) = pointer { fields.queued.push(QueuedWheel { frame,