[apps/sequence] Draw only visible dots when range is too big.

Change-Id: I8624fa3063d1787049510f4063f562d900f002c5
This commit is contained in:
Émilie Feral
2017-04-14 09:44:48 +02:00
parent 3c4bd2b578
commit 2a9084aab6
3 changed files with 10 additions and 3 deletions

View File

@@ -48,8 +48,13 @@ bool GraphController::moveCursorHorizontally(int direction) {
if (direction < 0 && xCursorPosition <= 0) {
return false;
}
float x = direction > 0 ? xCursorPosition + 1.0f :
xCursorPosition - 1.0f;
float step = ceilf((interactiveCurveViewRange()->xMax()-interactiveCurveViewRange()->xMin())/GraphView::k_precision);
step = step < 1.0f ? 1.0f : step;
float x = direction > 0 ? xCursorPosition + step:
xCursorPosition - step;
if (x < 0.0f) {
return false;
}
Sequence * s = m_sequenceStore->activeFunctionAtIndex(m_indexFunctionSelectedByCursor);
TextFieldDelegateApp * myApp = (TextFieldDelegateApp *)app();
float y = s->evaluateAtAbscissa(x, myApp->localContext());