mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[function_graph_controller] Fix Y range expansion
The method FunctionGraphController::yRangeForCursorFirstMove expands the Y range to include the values of the first cursor moves on the left and the right of the center. It has been modified to preserve orthonormality. Change-Id: I898ab9721e45e2acde261f8b94b80cab81b39a92
This commit is contained in:
committed by
Émilie Feral
parent
f54b15b9c8
commit
bcb4b3095b
@@ -165,6 +165,8 @@ void FunctionGraphController::yRangeForCursorFirstMove(InteractiveCurveViewRange
|
||||
float cursorStep = range->xGridUnit() / k_numberOfCursorStepsInGradUnit;
|
||||
float yN, yP;
|
||||
|
||||
bool normalized = range->isOrthonormal();
|
||||
|
||||
for (int i = 0; i < functionsCount; i++) {
|
||||
ExpiringPointer<Function> f = functionStore()->modelForRecord(functionStore()->activeRecordAtIndex(i));
|
||||
yN = f->evaluateXYAtParameter(range->xCenter() - cursorStep, context).x2();
|
||||
@@ -172,6 +174,10 @@ void FunctionGraphController::yRangeForCursorFirstMove(InteractiveCurveViewRange
|
||||
range->setYMin(std::min(range->yMin(), std::min(yN, yP)));
|
||||
range->setYMax(std::max(range->yMax(), std::max(yN, yP)));
|
||||
}
|
||||
|
||||
if (normalized) {
|
||||
range->normalize();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user