[apps/graph] GraphController: when moving cursor vertically (on non

cartesian functions), going down increases the function index (to mimic
their vertical order in the function list)
This commit is contained in:
Émilie Feral
2019-09-02 14:08:20 +02:00
parent 6de497c2ed
commit f017ac014d

View File

@@ -71,7 +71,7 @@ int GraphController::closestCurveIndexVertically(bool goingUp, int currentSelect
if (functionStore()->numberOfActiveFunctionsOfType(CartesianFunction::PlotType::Cartesian) == nbOfActiveFunctions) {
return FunctionGraphController::closestCurveIndexVertically(goingUp, currentSelectedCurve, context);
}
int nextActiveFunctionIndex = currentSelectedCurve + (goingUp ? 1 : -1);
int nextActiveFunctionIndex = currentSelectedCurve + (goingUp ? -1 : 1);
return nextActiveFunctionIndex >= nbOfActiveFunctions ? -1 : nextActiveFunctionIndex;
}