diff --git a/Cargo.toml b/Cargo.toml index a286e13..10e0bff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ lto = false [dependencies] meval = { git = "https://github.com/Titaniumtown/meval-rs.git" } -eframe = { git = "https://github.com/Titaniumtown/egui", default-features = false, features = ["egui_glow"] } +eframe = { git = "https://github.com/Titaniumtown/egui", branch = "patch-1", default-features = false, features = ["egui_glow"] } git-version = "0.3.5" include-flate = { git = "https://github.com/Titaniumtown/include-flate.git" } diff --git a/src/egui_app.rs b/src/egui_app.rs index f36bdf5..f50faac 100644 --- a/src/egui_app.rs +++ b/src/egui_app.rs @@ -251,17 +251,17 @@ impl epi::App for MathApp { for (i, function) in self.functions.iter_mut().enumerate() { let mut integral_toggle: bool = false; - + let integral_enabled = function.integral; // Entry for a function ui.horizontal(|ui| { ui.label("Function: "); - let mut integral_opt_text = "Integrate"; - if function.integral { - integral_opt_text = "Don't integrate"; - } if ui .add(Button::new("∫")) - .on_hover_text(integral_opt_text) + .on_hover_text(if integral_enabled { + "Don't integrate" + } else { + "Integrate" + }) .clicked() { integral_toggle = true; @@ -270,9 +270,9 @@ impl epi::App for MathApp { }); let integral: bool = if integral_toggle { - !function.integral + !integral_enabled } else { - function.integral + integral_enabled }; if !self.func_strs[i].is_empty() { diff --git a/src/lib.rs b/src/lib.rs index 1e1faf1..51c21a3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -35,9 +35,7 @@ pub fn start(canvas_id: &str) -> Result<(), wasm_bindgen::JsValue> { // Used in order to hook into `panic!()` to log in the browser's console log_helper("Initializing panic hooks..."); - std::panic::set_hook(Box::new(|panic_info| { - console_error_panic_hook::hook(panic_info); - })); + std::panic::set_hook(Box::new(console_error_panic_hook::hook)); log_helper("Initialized panic hooks!"); log_helper("Finished initializing!");