diff --git a/src/egui_app.rs b/src/egui_app.rs index 2ac5f8f..64cd081 100644 --- a/src/egui_app.rs +++ b/src/egui_app.rs @@ -22,19 +22,23 @@ const DEFAULT_FUNCION: &str = "x^2"; // Default function that appears when addin flate!(static FONT_DATA: [u8] from "assets/Ubuntu-Light.ttf"); pub struct MathApp { + // Stores vector of functions functions: Vec, - // No clue why I need this, but I do. Rust being weird I guess. - // Ideally this should be information directly accessed from `functions` but it always returns an empty string. I don't know, I've been debuging this for a while now. + // Stores vector containing the string representation of the functions. This is used because of hacky reasons func_strs: Vec, + // Min and Max range for calculating an integral integral_min_x: f64, integral_max_x: f64, + // Number of rectangles used to calculate integral integral_num: usize, + // Stores whether or not the help window is open help_open: bool, + // Stores font data that's used when displaying text font: FontData, } diff --git a/src/function.rs b/src/function.rs index dffacee..9c6de5f 100644 --- a/src/function.rs +++ b/src/function.rs @@ -187,6 +187,7 @@ impl Function { } // Creates and does the math for creating all the rectangles under the graph + // TODO: fix this stuff, it's half broken fn integral_rectangles(&self) -> (Vec<(f64, f64)>, f64) { if self.integral_min_x.is_nan() { panic!("integral_min_x is NaN")