From 2831d352da6d346ec919ee2ee24a8f370da55fc0 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Mon, 28 Feb 2022 11:43:23 -0500 Subject: [PATCH] fix --- src/egui_app.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/egui_app.rs b/src/egui_app.rs index 981b29a..3a17d0b 100644 --- a/src/egui_app.rs +++ b/src/egui_app.rs @@ -158,7 +158,6 @@ impl epi::App for MathApp { ui.add(egui::Slider::new(&mut self.integral_num, INTEGRAL_NUM_RANGE).text("Interval")); for (i, function) in self.functions.iter_mut().enumerate() { - let old_func_str = self.func_strs[i].clone(); let mut integral_toggle: bool = false; // Entry for a function @@ -176,20 +175,16 @@ impl epi::App for MathApp { function.is_integral() }; - let proc_func_str = add_asterisks(self.func_strs[i].clone()); - let mut do_update: bool = true; - if !self.func_strs[i].is_empty() && (proc_func_str != old_func_str) { + if !self.func_strs[i].is_empty() { + let proc_func_str = add_asterisks(self.func_strs[i].clone()); let func_test_output = test_func(proc_func_str.clone()); if !func_test_output.is_empty() { parse_error += &format!("(Function #{}) ", i); parse_error += &func_test_output; - do_update = false; + } else { + function.update(proc_func_str, integral, Some(self.integral_min_x), Some(self.integral_max_x), Some(self.integral_num)); } } - - if do_update { - function.update(proc_func_str, integral, Some(self.integral_min_x), Some(self.integral_max_x), Some(self.integral_num)); - } } // Open Source and Licensing information