UI improvements
This commit is contained in:
parent
2a5e30b15e
commit
ed5bd66998
@ -55,7 +55,7 @@ impl Default for MathApp {
|
|||||||
integral_min_x: def_min_x,
|
integral_min_x: def_min_x,
|
||||||
integral_max_x: def_max_x,
|
integral_max_x: def_max_x,
|
||||||
integral_num: def_interval,
|
integral_num: def_interval,
|
||||||
help_open: true,
|
help_open: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -220,7 +220,8 @@ impl epi::App for MathApp {
|
|||||||
|
|
||||||
let step = (self.integral_min_x - self.integral_max_x).abs() / (self.integral_num as f64);
|
let step = (self.integral_min_x - self.integral_max_x).abs() / (self.integral_num as f64);
|
||||||
|
|
||||||
// Stores the final Plot
|
let mut area_list: Vec<f64> = Vec::new(); // Stores list of areas resulting from calculating the integral of functions
|
||||||
|
// Stores the final Plot
|
||||||
egui::CentralPanel::default().show(ctx, |ui| {
|
egui::CentralPanel::default().show(ctx, |ui| {
|
||||||
if !parse_error.is_empty() {
|
if !parse_error.is_empty() {
|
||||||
ui.label(format!("Error: {}", parse_error));
|
ui.label(format!("Error: {}", parse_error));
|
||||||
@ -228,7 +229,6 @@ impl epi::App for MathApp {
|
|||||||
}
|
}
|
||||||
let available_width: usize = ui.available_width() as usize;
|
let available_width: usize = ui.available_width() as usize;
|
||||||
|
|
||||||
let mut area_list: Vec<f64> = Vec::new(); // Stores list of areas resulting from calculating the integral of functions
|
|
||||||
Plot::new("plot")
|
Plot::new("plot")
|
||||||
.set_margin_fraction(Vec2::ZERO)
|
.set_margin_fraction(Vec2::ZERO)
|
||||||
.view_aspect(1.0)
|
.view_aspect(1.0)
|
||||||
@ -263,15 +263,18 @@ impl epi::App for MathApp {
|
|||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let duration = start.elapsed();
|
|
||||||
|
|
||||||
// Displays all areas of functions along with how long it took to complete the entire frame
|
|
||||||
ui.label(format!(
|
|
||||||
"Area: {:?} Took: {:?}",
|
|
||||||
area_list.clone(),
|
|
||||||
duration
|
|
||||||
));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let duration = start.elapsed();
|
||||||
|
egui::Window::new("Info")
|
||||||
|
.default_pos([200.0, 200.0])
|
||||||
|
.show(ctx, |ui| {
|
||||||
|
// Displays all areas of functions along with how long it took to complete the entire frame
|
||||||
|
ui.label(format!(
|
||||||
|
"Area: {:?} Took: {:?}",
|
||||||
|
area_list.clone(),
|
||||||
|
duration
|
||||||
|
));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,34 +48,4 @@ canvas {
|
|||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
font-family: Ubuntu-Light, Helvetica, sans-serif;
|
font-family: Ubuntu-Light, Helvetica, sans-serif;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------- */
|
|
||||||
/* Loading animation from https://loading.io/css/ */
|
|
||||||
.lds-dual-ring {
|
|
||||||
display: inline-block;
|
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lds-dual-ring:after {
|
|
||||||
content: " ";
|
|
||||||
display: block;
|
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
|
||||||
margin: 0px;
|
|
||||||
border-radius: 50%;
|
|
||||||
border: 3px solid #fff;
|
|
||||||
border-color: #fff transparent #fff transparent;
|
|
||||||
animation: lds-dual-ring 1.2s linear infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes lds-dual-ring {
|
|
||||||
0% {
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
100% {
|
|
||||||
transform: rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user