From 5a3da1dac01712038576740130e6cdf2e4bfc191 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Fri, 4 Mar 2022 11:41:51 -0500 Subject: [PATCH] rename IntegralDisplay --- src/egui_app.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/egui_app.rs b/src/egui_app.rs index ced4970..acd52d7 100644 --- a/src/egui_app.rs +++ b/src/egui_app.rs @@ -18,12 +18,12 @@ shadow!(build); // Represents the method in which an integral should be displayed #[derive(PartialEq, Debug, Copy, Clone)] -enum DisplayIntegral { +enum IntegralDisplay { Rectangles, - Plot, + Line, } -impl fmt::Display for DisplayIntegral { +impl fmt::Display for IntegralDisplay { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{:?}", self) } } @@ -110,7 +110,7 @@ struct AppSettings { pub integral_num: usize, // Stores how integrals should be displayed - pub integral_display_type: DisplayIntegral, + pub integral_display_type: IntegralDisplay, } impl Default for AppSettings { @@ -123,7 +123,7 @@ impl Default for AppSettings { integral_min_x: DEFAULT_MIN_X, integral_max_x: DEFAULT_MAX_X, integral_num: DEFAULT_INTEGRAL_NUM, - integral_display_type: DisplayIntegral::Rectangles, + integral_display_type: IntegralDisplay::Rectangles, } } } @@ -180,12 +180,12 @@ impl MathApp { .show_ui(ui, |ui| { ui.selectable_value( &mut self.settings.integral_display_type, - DisplayIntegral::Rectangles, + IntegralDisplay::Rectangles, "Rectangles", ); ui.selectable_value( &mut self.settings.integral_display_type, - DisplayIntegral::Plot, + IntegralDisplay::Line, "Line", ); }); @@ -480,9 +480,9 @@ impl epi::App for MathApp { if let Some(bars_data) = bars { let (integral_bar, integral_line, area) = bars_data; match self.settings.integral_display_type { - DisplayIntegral::Rectangles => plot_ui + IntegralDisplay::Rectangles => plot_ui .bar_chart(integral_bar.color(Color32::BLUE).width(step)), - DisplayIntegral::Plot => { + IntegralDisplay::Line => { plot_ui.line(integral_line.color(Color32::BLUE)) } }