[apps/shared] In graph, enable cursor to be at infinity without moving range

Change-Id: I6de1593a3017d28c0187a0a3ab3f19b7cbbaa667
This commit is contained in:
Émilie Feral
2017-04-07 13:48:50 +02:00
parent 8f137514a8
commit e6e31adee7
2 changed files with 5 additions and 2 deletions

View File

@@ -23,8 +23,8 @@ void CurveViewCursor::moveTo(float x, float y) {
}
float CurveViewCursor::clipped(float x) {
float clippedX = x > k_maxFloat ? k_maxFloat : x;
clippedX = clippedX < - k_maxFloat ? -k_maxFloat : clippedX;
float clippedX = x > k_maxFloat ? INFINITY : x;
clippedX = clippedX < - k_maxFloat ? -INFINITY : clippedX;
return clippedX;
}

View File

@@ -65,6 +65,9 @@ bool FunctionGraphController::didChangeRange(InteractiveCurveViewRange * interac
}
}
float range = max - min;
if (max < min) {
range = 0.0f;
}
if (interactiveCurveViewRange->yMin() == min-k_displayBottomMarginRatio*range
&& interactiveCurveViewRange->yMax() == max+k_displayTopMarginRatio*range) {
return false;