[apps/reg] Init the graph selected series at cursor initialization

This commit is contained in:
Léa Saviot
2018-05-30 15:31:50 +02:00
parent 7f71faf0c2
commit 32e00b5e1e
3 changed files with 32 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ GraphController::GraphController(Responder * parentResponder, ButtonRowControlle
m_initialisationParameterController(this, m_store),
m_predictionParameterController(this, m_store, m_cursor, this),
m_selectedDotIndex(selectedDotIndex),
m_selectedSeries(0) // TODO -1
m_selectedSeries(-1)
{
m_store->setCursor(m_cursor);
}
@@ -191,7 +191,7 @@ void GraphController::initRangeParameters() {
}
void GraphController::initCursorParameters() {
assert(m_selectedSeries >= 0);
m_selectedSeries = m_store->indexOfKthNonEmptySeries(0);
double x = m_store->meanOfColumn(m_selectedSeries, 0);
double y = m_store->meanOfColumn(m_selectedSeries, 1);
m_cursor->moveTo(x, y);