mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/shared/function_graph_controller] Clarify function selection in initCursorParameters
This commit is contained in:
committed by
Léa Saviot
parent
1cdd61ea47
commit
246a9aa7a4
@@ -140,13 +140,15 @@ void FunctionGraphController::initCursorParameters() {
|
||||
Coordinate2D<double> xy;
|
||||
double t;
|
||||
do {
|
||||
Ion::Storage::Record record = functionStore()->activeRecordAtIndex(functionIndex++);
|
||||
Ion::Storage::Record record = functionStore()->activeRecordAtIndex(functionIndex);
|
||||
ExpiringPointer<Function> firstFunction = functionStore()->modelForRecord(record);
|
||||
t = defaultCursorT(record);
|
||||
xy = firstFunction->evaluateXYAtParameter(t, context);
|
||||
} while ((std::isnan(xy.x2()) || std::isinf(xy.x2())) && functionIndex < activeFunctionsCount);
|
||||
} while ((std::isnan(xy.x2()) || std::isinf(xy.x2())) && ++functionIndex < activeFunctionsCount);
|
||||
if (functionIndex == activeFunctionsCount) {
|
||||
functionIndex = 0;
|
||||
}
|
||||
m_cursor->moveTo(t, xy.x1(), xy.x2());
|
||||
functionIndex = (std::isnan(xy.x2()) || std::isinf(xy.x2())) ? 0 : functionIndex - 1;
|
||||
selectFunctionWithCursor(functionIndex);
|
||||
if (interactiveCurveViewRange()->yAuto()) {
|
||||
interactiveCurveViewRange()->panToMakePointVisible(xy.x1(), xy.x2(), cursorTopMarginRatio(), k_cursorRightMarginRatio, cursorBottomMarginRatio(), k_cursorLeftMarginRatio);
|
||||
|
||||
Reference in New Issue
Block a user