when added, new functions should be blank
This commit is contained in:
parent
50333a6f41
commit
c84a98f291
@ -337,18 +337,22 @@ impl epi::App for MathApp {
|
||||
.on_hover_text("Create and graph new function")
|
||||
.clicked()
|
||||
{
|
||||
self.functions.push(Function::new(
|
||||
String::from(DEFAULT_FUNCION),
|
||||
-1.0, // Doesn't matter, updated later
|
||||
1.0, // Doesn't matter, updated later
|
||||
100, // Doesn't matter, updated later
|
||||
false,
|
||||
None, // Doesn't matter, updated later
|
||||
None, // Doesn't matter, updated later
|
||||
None, // Doesn't matter, updated later
|
||||
Some(self.settings.sum),
|
||||
));
|
||||
self.func_strs.push(String::from(DEFAULT_FUNCION));
|
||||
self.functions.push({
|
||||
let mut function = Function::new(
|
||||
String::from(DEFAULT_FUNCION),
|
||||
-1.0, // Doesn't matter, updated later
|
||||
1.0, // Doesn't matter, updated later
|
||||
100, // Doesn't matter, updated later
|
||||
false,
|
||||
None, // Doesn't matter, updated later
|
||||
None, // Doesn't matter, updated later
|
||||
None, // Doesn't matter, updated later
|
||||
Some(self.settings.sum),
|
||||
);
|
||||
function.func_str = String::new();
|
||||
function
|
||||
});
|
||||
self.func_strs.push(String::new());
|
||||
}
|
||||
|
||||
if ui
|
||||
|
||||
@ -169,9 +169,7 @@ impl Function {
|
||||
|
||||
pub fn run(&mut self) -> (Line, Option<(BarChart, f64)>) {
|
||||
let back_values: Line = Line::new(Values::from_values(match self.back_cache.is_some() {
|
||||
true => {
|
||||
self.back_cache.as_ref().unwrap().clone()
|
||||
}
|
||||
true => self.back_cache.as_ref().unwrap().clone(),
|
||||
false => {
|
||||
let absrange = (self.max_x - self.min_x).abs();
|
||||
let resolution: f64 = (self.pixel_width as f64 / absrange) as f64;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user