[apps/sequence] Add Y range to interestingRanges

The computation of Sequence's graph default Y range used to rely on
Yauto. As this feature does not exist anymore, this work is now done int
Sequence::GraphController::interestingRanges.

Change-Id: Idba8560d5f25d0bf34dd0e1dd98c2af67f427709
This commit is contained in:
Gabriel Ozouf
2020-10-02 17:56:12 +02:00
committed by Émilie Feral
parent 1d4d56a7dd
commit 0f1e27b2b6

View File

@@ -60,6 +60,19 @@ void GraphController::interestingRanges(InteractiveCurveViewRange * range) const
range->setXMin(nmin);
range->setXMax(nmax);
Context * context = textFieldDelegateApp()->localContext();
float yMin = FLT_MAX, yMax = -FLT_MAX;
for (int i = 0; i < nbOfActiveModels; i++) {
Shared::Sequence * s = functionStore()->modelForRecord(functionStore()->activeRecordAtIndex(i));
Zoom::ValueAtAbscissa evaluation = [](float x, Context * context, const void * auxiliary) {
return static_cast<const Shared::Sequence *>(auxiliary)->evaluateXYAtParameter(x, context).x2();
};
Zoom::RefinedYRangeForDisplay(evaluation, nmin, nmax, &yMin, &yMax, context, s);
}
range->setYMin(yMin);
range->setYMax(yMax);
}
bool GraphController::textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) {