[apps/continuous_function_cache] Clear on bad step

Cache did not check that the step was the same before panning, causing
old values to remains cached.
e.g. :
  - Type f(x) = x, and plot it.
  - Go to Axes, and set Xmax = 0.
  - Confirm

Change-Id: Ie8ed10c336cf517a65f19b05bd14866daf8128c2
This commit is contained in:
Gabriel Ozouf
2020-09-22 17:49:06 +02:00
committed by Émilie Feral
parent 3f19d66c78
commit bd068312d9

View File

@@ -31,6 +31,10 @@ void ContinuousFunctionCache::PrepareForCaching(void * fun, ContinuousFunctionCa
function->setCache(cache);
}
if (tStep != 0. && tStep != cache->step()) {
cache->clear();
}
if (function->plotType() == ContinuousFunction::PlotType::Cartesian && tStep != 0) {
function->cache()->pan(function, tMin);
}