From bd068312d90b95bf924ecaec8241f5a2fe1cc3a2 Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Tue, 22 Sep 2020 17:49:06 +0200 Subject: [PATCH] [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 --- apps/shared/continuous_function_cache.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/shared/continuous_function_cache.cpp b/apps/shared/continuous_function_cache.cpp index ad1e0e98c..62064532d 100644 --- a/apps/shared/continuous_function_cache.cpp +++ b/apps/shared/continuous_function_cache.cpp @@ -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); }