mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/graph] Fix graph selection when a function is undef
For instance, input f(x)=1/0 and g(x)=1, the graph tab now selects g correctly
This commit is contained in:
@@ -24,6 +24,22 @@ Function * FunctionStore::activeFunctionAtIndex(int i) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int FunctionStore::activeFunctionStoreIndex(int i) {
|
||||
assert(i>=0 && i<numberOfActiveFunctions());
|
||||
int index = 0;
|
||||
for (int k = 0; k < m_numberOfModels; k++) {
|
||||
Function * function = modelAtIndex(k);
|
||||
if (function->isActive() && function->isDefined()) {
|
||||
if (i == index) {
|
||||
return k;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
assert(false);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int FunctionStore::numberOfActiveFunctions() {
|
||||
int result = 0;
|
||||
for (int i = 0; i < m_numberOfModels; i++) {
|
||||
|
||||
Reference in New Issue
Block a user