[apps] Factorize InteractiveCurveViewController::moveCursorVertically

This commit is contained in:
Ruben Dashyan
2019-03-20 13:44:21 +01:00
committed by Émilie Feral
parent f6ceae3b8b
commit 94cf542ba3
3 changed files with 4 additions and 4 deletions

View File

@@ -312,7 +312,6 @@ bool GraphController::moveCursorVertically(int direction) {
*m_selectedSeriesIndex = closestRegressionSeries;
selectRegressionCurve();
m_cursor->moveTo(x, yValue(*m_selectedSeriesIndex, x, context));
m_store->panToMakePointVisible(m_cursor->x(), m_cursor->y(), cursorTopMarginRatio(), k_cursorRightMarginRatio, cursorBottomMarginRatio(), k_cursorLeftMarginRatio);
return true;
}
@@ -324,11 +323,9 @@ bool GraphController::moveCursorVertically(int direction) {
if (dotSelected == m_store->numberOfPairsOfSeries(*m_selectedSeriesIndex)) {
// Select the mean dot
m_cursor->moveTo(m_store->meanOfColumn(*m_selectedSeriesIndex, 0), m_store->meanOfColumn(*m_selectedSeriesIndex, 1));
m_store->panToMakePointVisible(m_cursor->x(), m_cursor->y(), cursorTopMarginRatio(), k_cursorRightMarginRatio, cursorBottomMarginRatio(), k_cursorLeftMarginRatio);
} else {
// Select a data point dot
m_cursor->moveTo(m_store->get(*m_selectedSeriesIndex, 0, *m_selectedDotIndex), m_store->get(*m_selectedSeriesIndex, 1, *m_selectedDotIndex));
m_store->panToMakePointVisible(m_cursor->x(), m_cursor->y(), cursorTopMarginRatio(), k_cursorRightMarginRatio, cursorBottomMarginRatio(), k_cursorLeftMarginRatio);
}
return true;
}