mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[shared/continous_function] Detach cache of inactive function
When a function that had previously been cached is deactivated, its
cache can be used by another function. When the function is reactivated,
if it tries to reuse its previous cache, it will be filled with values
from another function, and will not be cleared. By detaching the cache
of a function that becomes inactive, we ensure that the next time this
function is cached, the chache will be cleared.
e.g. Define to functions f(x)=x, g(x)=-x, draw them both.
Deactivate f, the redraw the graph
Reactivate f, the draw again
This commit is contained in:
committed by
LeaNumworks
parent
3501146e35
commit
937979503a
@@ -50,6 +50,9 @@ KDColor Function::color() const {
|
||||
|
||||
void Function::setActive(bool active) {
|
||||
recordData()->setActive(active);
|
||||
if (!active) {
|
||||
functionBecameInactive();
|
||||
}
|
||||
}
|
||||
|
||||
int Function::printValue(double cursorT, double cursorX, double cursorY, char * buffer, int bufferSize, int precision, Poincare::Context * context) {
|
||||
|
||||
Reference in New Issue
Block a user