[apps] Factorize scrolling speed for long repetition

Change-Id: I5fcfaf04e418942664641c4b1cd044cda7f5aebb
This commit is contained in:
Hugo Saint-Vignes
2020-06-09 17:42:49 +02:00
committed by Émilie Feral
parent 241a217f58
commit b60c67ff88
16 changed files with 23 additions and 24 deletions

View File

@@ -219,7 +219,7 @@ void GraphController::reloadBannerView() {
m_bannerView.reload();
}
bool GraphController::moveCursorHorizontally(int direction, bool fast) {
bool GraphController::moveCursorHorizontally(int direction, int scrollSpeed) {
double x;
double y;
if (*m_selectedDotIndex >= 0) {
@@ -235,10 +235,7 @@ bool GraphController::moveCursorHorizontally(int direction, bool fast) {
}
*m_selectedDotIndex = dotSelected;
} else {
double step = direction * m_store->xGridUnit()/k_numberOfCursorStepsInGradUnit;
if (fast) {
step *= 5.0;
}
double step = direction * scrollSpeed * m_store->xGridUnit()/k_numberOfCursorStepsInGradUnit;
x = m_cursor->x() + step;
y = yValue(*m_selectedSeriesIndex, x, globalContext());
}