From 59eb97a3fe3840ef1f73cd2083827ebdc05e778f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 29 May 2017 11:42:15 +0200 Subject: [PATCH] [apps/sequene][apps/graph] Fix bug, reinit the selected function when the model has changed Change-Id: I9004d63d9d06a090a144fb3757143c5776e54ed3 --- apps/shared/function_graph_controller.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/shared/function_graph_controller.cpp b/apps/shared/function_graph_controller.cpp index 2b5f0f00a..36c141819 100644 --- a/apps/shared/function_graph_controller.cpp +++ b/apps/shared/function_graph_controller.cpp @@ -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) {