formatting and comments

This commit is contained in:
Simon Gardling 2022-03-04 08:36:41 -05:00
parent e201d61045
commit 4806bb44ae
2 changed files with 2 additions and 2 deletions

View File

@ -393,7 +393,7 @@ impl epi::App for MathApp {
self.side_panel(ctx); self.side_panel(ctx);
} }
// Central panel which contains the central plot along or an error when parsing // Central panel which contains the central plot (or an error created when parsing)
CentralPanel::default().show(ctx, |ui| { CentralPanel::default().show(ctx, |ui| {
if !self.last_error.is_empty() { if !self.last_error.is_empty() {
ui.centered_and_justified(|ui| { ui.centered_and_justified(|ui| {

View File

@ -189,7 +189,7 @@ impl Function {
let data2: Vec<(f64, f64)> = (1..=self.integral_num) let data2: Vec<(f64, f64)> = (1..=self.integral_num)
.map(|e| { .map(|e| {
let x: f64 = ((e as f64) * step) + self.integral_min_x; let x: f64 = ((e as f64) * step) + self.integral_min_x;
let step_offset = step * x.signum(); let step_offset = step * x.signum(); // store the offset here so it doesn't have to be calculated multiple times
let x2: f64 = x + step_offset; let x2: f64 = x + step_offset;
let (left_x, right_x) = match x.is_sign_positive() { let (left_x, right_x) = match x.is_sign_positive() {