diff --git a/apps/graph/graph/graph_controller_helper.cpp b/apps/graph/graph/graph_controller_helper.cpp index 6d276e3d4..ecfc78f18 100644 --- a/apps/graph/graph/graph_controller_helper.cpp +++ b/apps/graph/graph/graph_controller_helper.cpp @@ -9,9 +9,6 @@ using namespace Poincare; namespace Graph { -static inline float minFloat(float x, float y) { return x < y ? x : y; } -static inline float maxFloat(float x, float y) { return x > y ? x : y; } - bool GraphControllerHelper::privateMoveCursorHorizontally(Shared::CurveViewCursor * cursor, int direction, Shared::InteractiveCurveViewRange * range, int numberOfStepsInGradUnit, Ion::Storage::Record record) { ExpiringPointer function = App::app()->functionStore()->modelForRecord(record); double tCursorPosition = cursor->t(); @@ -20,18 +17,12 @@ bool GraphControllerHelper::privateMoveCursorHorizontally(Shared::CurveViewCurso double tMax = function->tMax(); double dir = (direction > 0 ? 1.0 : -1.0); CartesianFunction::PlotType type = function->plotType(); - if ((dir > 0 && t >= tMax) || (dir < 0 && t <= tMin)) { - // Stay inside the definition domain - assert((t == tMax) || (t == tMin)); - return true; - } if (type == CartesianFunction::PlotType::Cartesian) { t+= dir * range->xGridUnit()/numberOfStepsInGradUnit; } else { assert(type == CartesianFunction::PlotType::Polar || type == CartesianFunction::PlotType::Parametric); t += dir * (tMax-tMin)/k_definitionDomainDivisor; } - t = maxFloat(minFloat(t, tMax), tMin); // Stay inside the definition domain Coordinate2D xy = function->evaluateXYAtParameter(t, App::app()->localContext()); cursor->moveTo(t, xy.x1(), xy.x2()); return true;