[apps/shared] computeYRange clips tMin..tMax to xMin..xMax if possible

This commit is contained in:
Léa Saviot
2019-08-30 10:17:12 +02:00
parent 8c7819306a
commit 850170e33b
4 changed files with 7 additions and 0 deletions

View File

@@ -92,10 +92,14 @@ InteractiveCurveViewRangeDelegate::Range FunctionGraphController::computeYRange(
double tMin = f->tMin();
if (std::isnan(tMin)) {
tMin = xMin;
} else if (f->shouldClipTRangeToXRange()) {
tMin = maxFloat(tMin, xMin);
}
double tMax = f->tMax();
if (std::isnan(tMax)) {
tMax = xMax;
} else if (f->shouldClipTRangeToXRange()) {
tMax = minFloat(tMax, xMax);
}
const int balancedBound = std::floor((tMax-tMin)/2/step);
for (int j = -balancedBound; j <= balancedBound ; j++) {