mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[apps/graph] Changed cache tolerance
This fixes a bug where, when drawing 1/x, a vertical bar would appear on 0, because of false positive cache hits. Change-Id: I2eafeac5e254c8a556769a41c8edc532db44383a
This commit is contained in:
committed by
Émilie Feral
parent
beb228fa78
commit
b0533e6836
@@ -19,6 +19,14 @@ void ContinuousFunctionCache::PrepareForCaching(void * fun, ContinuousFunctionCa
|
||||
}
|
||||
|
||||
ContinuousFunction * function = static_cast<ContinuousFunction *>(fun);
|
||||
if (tStep < 3 * k_cacheHitTolerance) {
|
||||
/* If tStep is lower than twice the tolerance, we risk shifting the index
|
||||
* by 1 for cache hits. As an added safety, we add another buffer of
|
||||
* k_cacheHitTolerance, raising the threshold for caching to three times
|
||||
* the tolerance. */
|
||||
function->clearCache();
|
||||
return;
|
||||
}
|
||||
if (function->cache() != cache) {
|
||||
cache->clear();
|
||||
function->setCache(cache);
|
||||
|
||||
Reference in New Issue
Block a user