[poincare/zoom] Remove tuneXRange argument

The ability to perform a range search without changing the X range was
only there to accomodate the Yauto feature.

Change-Id: I8c2b61b447fbd3dc1f4e303dff06d1a8d6e7a4f2
This commit is contained in:
Gabriel Ozouf
2020-10-08 11:56:21 +02:00
committed by Émilie Feral
parent 07c52139b9
commit ad6edffc07
9 changed files with 32 additions and 41 deletions

View File

@@ -137,20 +137,16 @@ int FunctionGraphController::numberOfCurves() const {
}
void FunctionGraphController::interestingRanges(InteractiveCurveViewRange * range) const {
privateComputeRanges(true, range);
}
void FunctionGraphController::privateComputeRanges(bool tuneXRange, InteractiveCurveViewRange * range) const {
Poincare::Context * context = textFieldDelegateApp()->localContext();
float resultXMin = tuneXRange ? FLT_MAX : range->xMin();
float resultXMax = tuneXRange ? -FLT_MAX : range->xMax();
float resultXMin = FLT_MAX;
float resultXMax = -FLT_MAX;
float resultYMin = FLT_MAX;
float resultYMax = -FLT_MAX;
assert(functionStore()->numberOfActiveFunctions() > 0);
int functionsCount = functionStore()->numberOfActiveFunctions();
for (int i = 0; i < functionsCount; i++) {
ExpiringPointer<Function> f = functionStore()->modelForRecord(functionStore()->activeRecordAtIndex(i));
f->rangeForDisplay(&resultXMin, &resultXMax, &resultYMin, &resultYMax, context, tuneXRange);
f->rangeForDisplay(&resultXMin, &resultXMax, &resultYMin, &resultYMax, context);
}
range->setXMin(resultXMin);