[apps/graph] If only cartesians, jump to next curve when out of range

Scenario:

-----------•   ->press "right": the cursor goes on the lower curve

           -*-*-*-*-*-
This commit is contained in:
Léa Saviot
2019-09-23 15:30:56 +02:00
committed by EmilieNumworks
parent f037df0ab5
commit e9974a216d
5 changed files with 59 additions and 1 deletions

View File

@@ -19,6 +19,14 @@ bool GraphControllerHelper::privateMoveCursorHorizontally(Shared::CurveViewCurso
double t = tCursorPosition;
double tMin = function->tMin();
double tMax = function->tMax();
int functionsCount = -1;
if (((direction > 0 && std::abs(t-tMax) < DBL_EPSILON)
|| (direction < 0 && std::abs(t-tMin) < DBL_EPSILON))
&& !App::app()->functionStore()->displaysNonCartesianFunctions(&functionsCount))
{
jumpToLeftRightCurve(t, direction, functionsCount, record);
return true;
}
double dir = (direction > 0 ? 1.0 : -1.0);
ContinuousFunction::PlotType type = function->plotType();
if (type == ContinuousFunction::PlotType::Cartesian) {