diff --git a/TODO.md b/TODO.md index c164343..45ab190 100644 --- a/TODO.md +++ b/TODO.md @@ -7,7 +7,6 @@ - Prevent user from making too many function entries - Display function errors as tooltips or a warning box (not preventing the display of the graph) - Clone functions - - Better integration with egui's legend 2. Smart display of graph - Display of intersections between functions 3. Allow constants in min/max integral input (like pi or euler's number) diff --git a/src/function_entry.rs b/src/function_entry.rs index 394925c..3ec5370 100644 --- a/src/function_entry.rs +++ b/src/function_entry.rs @@ -378,10 +378,6 @@ impl FunctionEntry { .collect(); debug_assert_eq!(data.len(), settings.plot_width + 1); self.derivative_data = data; - - unsafe { - assume(!self.derivative_data.is_empty()); - } } if self.nth_derviative && self.nth_derivative_data.is_none() { @@ -390,10 +386,6 @@ impl FunctionEntry { .collect(); debug_assert_eq!(data.len(), settings.plot_width + 1); self.nth_derivative_data = Some(data); - - unsafe { - assume(self.nth_derivative_data.is_some()); - } } } @@ -407,9 +399,6 @@ impl FunctionEntry { ); self.integral_data = Some((data.iter().map(|(x, y)| Bar::new(*x, *y)).collect(), area)); - unsafe { - assume(self.integral_data.is_some()); - } } } else { self.invalidate_integral(); diff --git a/src/math_app.rs b/src/math_app.rs index d92b3ed..f0dc732 100644 --- a/src/math_app.rs +++ b/src/math_app.rs @@ -566,17 +566,13 @@ impl App for MathApp { let available_width: usize = (ui.available_width() as usize) + 1; // Used in later logic let width_changed = available_width != self.settings.plot_width; - - if width_changed { - self.settings.plot_width = available_width; - } + self.settings.plot_width = available_width; // Create and setup plot Plot::new("plot") .set_margin_fraction(Vec2::ZERO) .data_aspect(1.0) .include_y(0) - .legend(egui::plot::Legend::default()) .show(ui, |plot_ui| { let bounds = plot_ui.plot_bounds(); let min_x: f64 = bounds.min()[0];