From 3c224d9872c82eab33e41f2505afceb44baeb9a3 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Wed, 25 May 2022 10:43:30 -0400 Subject: [PATCH] update egui --- Cargo.lock | 12 ++++++------ src/math_app.rs | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d32b91e..9d99a4b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -658,7 +658,7 @@ checksum = "453440c271cf5577fd2a40e4942540cb7d0d2f85e27c8d07dd0023c925a67541" [[package]] name = "eframe" version = "0.18.0" -source = "git+https://github.com/Titaniumtown/egui.git#781eab1f563f17b3e20588184ce50ef85a6e6893" +source = "git+https://github.com/Titaniumtown/egui.git#2481889aadfab5622212f10a40035dab4af2e8f6" dependencies = [ "bytemuck", "egui", @@ -678,7 +678,7 @@ dependencies = [ [[package]] name = "egui" version = "0.18.1" -source = "git+https://github.com/Titaniumtown/egui.git#781eab1f563f17b3e20588184ce50ef85a6e6893" +source = "git+https://github.com/Titaniumtown/egui.git#2481889aadfab5622212f10a40035dab4af2e8f6" dependencies = [ "ahash", "epaint", @@ -690,7 +690,7 @@ dependencies = [ [[package]] name = "egui-winit" version = "0.18.0" -source = "git+https://github.com/Titaniumtown/egui.git#781eab1f563f17b3e20588184ce50ef85a6e6893" +source = "git+https://github.com/Titaniumtown/egui.git#2481889aadfab5622212f10a40035dab4af2e8f6" dependencies = [ "arboard", "egui", @@ -704,7 +704,7 @@ dependencies = [ [[package]] name = "egui_glow" version = "0.18.1" -source = "git+https://github.com/Titaniumtown/egui.git#781eab1f563f17b3e20588184ce50ef85a6e6893" +source = "git+https://github.com/Titaniumtown/egui.git#2481889aadfab5622212f10a40035dab4af2e8f6" dependencies = [ "bytemuck", "egui", @@ -724,7 +724,7 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "emath" version = "0.18.0" -source = "git+https://github.com/Titaniumtown/egui.git#781eab1f563f17b3e20588184ce50ef85a6e6893" +source = "git+https://github.com/Titaniumtown/egui.git#2481889aadfab5622212f10a40035dab4af2e8f6" dependencies = [ "bytemuck", "serde", @@ -733,7 +733,7 @@ dependencies = [ [[package]] name = "epaint" version = "0.18.1" -source = "git+https://github.com/Titaniumtown/egui.git#781eab1f563f17b3e20588184ce50ef85a6e6893" +source = "git+https://github.com/Titaniumtown/egui.git#2481889aadfab5622212f10a40035dab4af2e8f6" dependencies = [ "ab_glyph", "ahash", diff --git a/src/math_app.rs b/src/math_app.rs index ae13c97..e9cfa0d 100644 --- a/src/math_app.rs +++ b/src/math_app.rs @@ -633,8 +633,19 @@ impl App for MathApp { self.last_info.1 = start.map(|a| format!("Took: {:?}", a.elapsed())); } - #[cfg(target_arch = "wasm32")] fn save(&mut self, _: &mut dyn eframe::Storage) { + #[cfg(target_arch = "wasm32")] + self.save_functions(); + } + + fn clear_color(&self, _visuals: &egui::Visuals) -> egui::Rgba { + crate::style::STYLE.window_fill().into() + } +} + +impl MathApp { + #[cfg(target_arch = "wasm32")] + fn save_functions(&self) { tracing::info!("Saving function data"); let hash: crate::misc::HashBytes = unsafe { std::mem::transmute::<&str, crate::misc::HashBytes>(build::SHORT_COMMIT) }; @@ -647,8 +658,4 @@ impl App for MathApp { .set_item(FUNC_NAME, saved_data) .expect("failed to set local function storage"); } - - fn clear_color(&self, _visuals: &egui::Visuals) -> egui::Rgba { - crate::style::STYLE.window_fill().into() - } }