[apps/sequene][apps/graph] Fix bug, reinit the selected function when

the model has changed

Change-Id: I9004d63d9d06a090a144fb3757143c5776e54ed3
This commit is contained in:
Émilie Feral
2017-05-29 11:42:15 +02:00
parent 832af9f9f4
commit 59eb97a3fe

View File

@@ -131,6 +131,7 @@ void FunctionGraphController::reloadBannerView() {
if (functionStore()->numberOfActiveFunctions() == 0) {
return;
}
assert(m_indexFunctionSelectedByCursor < functionStore()->numberOfActiveFunctions());
Function * f = functionStore()->activeFunctionAtIndex(m_indexFunctionSelectedByCursor);
buffer[0] = f->name()[0];
numberOfChar += Complex::convertFloatToText(m_cursor->y(), buffer+legendLength, Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits);
@@ -143,6 +144,7 @@ void FunctionGraphController::reloadBannerView() {
void FunctionGraphController::initRangeParameters() {
interactiveCurveViewRange()->setDefault();
initCursorParameters();
m_indexFunctionSelectedByCursor = 0;
}
bool FunctionGraphController::moveCursorVertically(int direction) {