[apps/graph/values_controller] Fix assertion in plotTypeAtColumn

This commit is contained in:
Ruben Dashyan
2019-11-12 14:58:44 +01:00
committed by EmilieNumworks
parent 3677e7b191
commit be6b9d804c

View File

@@ -237,10 +237,10 @@ int ValuesController::numberOfValuesColumns() {
ContinuousFunction::PlotType ValuesController::plotTypeAtColumn(int * i) const {
int plotTypeIndex = 0;
while (plotTypeIndex < ContinuousFunction::k_numberOfPlotTypes && *i >= numberOfColumnsForPlotType(plotTypeIndex)) {
while (*i >= numberOfColumnsForPlotType(plotTypeIndex)) {
*i -= numberOfColumnsForPlotType(plotTypeIndex++);
assert(plotTypeIndex < ContinuousFunction::k_numberOfPlotTypes);
}
assert(plotTypeIndex < ContinuousFunction::k_numberOfPlotTypes);
return static_cast<ContinuousFunction::PlotType>(plotTypeIndex);
}