HIGHLY optimize partial regen of values

This commit is contained in:
Simon Gardling
2022-05-24 14:04:02 -04:00
parent 4b29ce9333
commit ab8652ee3e
7 changed files with 99 additions and 211 deletions

View File

@@ -594,6 +594,8 @@ impl App for MathApp {
let max_x: f64 = bounds.max()[0];
let min_max_changed =
(min_x != self.settings.min_x) | (max_x != self.settings.max_x);
let did_zoom = (max_x - min_x).abs()
!= (self.settings.max_x - self.settings.min_x).abs();
self.settings.min_x = min_x;
self.settings.max_x = max_x;
@@ -601,7 +603,12 @@ impl App for MathApp {
.get_entries_mut()
.iter_mut()
.for_each(|(_, function)| {
function.calculate(width_changed, min_max_changed, &self.settings)
function.calculate(
width_changed,
min_max_changed,
did_zoom,
&self.settings,
)
});
let area: Vec<Option<f64>> = self