mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[graph] Fix bug when initializing the selected function on graph
This commit is contained in:
committed by
EmilieNumworks
parent
34198945f2
commit
d36c0c8746
@@ -9,26 +9,19 @@ FunctionStore::FunctionStore() :
|
||||
}
|
||||
|
||||
Function * FunctionStore::activeFunctionAtIndex(int i) {
|
||||
assert(i >= 0 && i < numberOfActiveFunctions());
|
||||
Function * function = modelAtIndex(activeFunctionStoreIndex(i));
|
||||
assert(function->isActive() && function->isDefined());
|
||||
return function;
|
||||
}
|
||||
|
||||
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;
|
||||
return function;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
assert(false);
|
||||
return -1;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int FunctionStore::numberOfActiveFunctions() {
|
||||
|
||||
Reference in New Issue
Block a user