mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[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:
committed by
Émilie Feral
parent
1d4d56a7dd
commit
0f1e27b2b6
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user