diff --git a/apps/graph/graph/graph_controller.cpp b/apps/graph/graph/graph_controller.cpp index a3b189687..46e1b1232 100644 --- a/apps/graph/graph/graph_controller.cpp +++ b/apps/graph/graph/graph_controller.cpp @@ -146,10 +146,10 @@ bool GraphController::moveCursorHorizontally(int direction) { return privateMoveCursorHorizontally(m_cursor, direction, m_graphRange, k_numberOfCursorStepsInGradUnit, record); } -int GraphController::closestCurveIndexVertically(bool goingUp, int currentSelectedCurve, Poincare::Context * context) const { +int GraphController::nextCurveIndexVertically(bool goingUp, int currentSelectedCurve, Poincare::Context * context) const { int nbOfActiveFunctions = functionStore()-> numberOfActiveFunctions(); if (functionStore()->numberOfActiveFunctionsOfType(ContinuousFunction::PlotType::Cartesian) == nbOfActiveFunctions) { - return FunctionGraphController::closestCurveIndexVertically(goingUp, currentSelectedCurve, context); + return FunctionGraphController::nextCurveIndexVertically(goingUp, currentSelectedCurve, context); } int nextActiveFunctionIndex = currentSelectedCurve + (goingUp ? -1 : 1); return nextActiveFunctionIndex >= nbOfActiveFunctions ? -1 : nextActiveFunctionIndex; diff --git a/apps/graph/graph/graph_controller.h b/apps/graph/graph/graph_controller.h index e2707ea0b..337b7c56a 100644 --- a/apps/graph/graph/graph_controller.h +++ b/apps/graph/graph/graph_controller.h @@ -28,7 +28,7 @@ private: BannerView * bannerView() override { return &m_bannerView; } void reloadBannerView() override; bool moveCursorHorizontally(int direction) override; - int closestCurveIndexVertically(bool goingUp, int currentSelectedCurve, Poincare::Context * context) const override; + int nextCurveIndexVertically(bool goingUp, int currentSelectedCurve, Poincare::Context * context) const override; double defaultCursorT(Ion::Storage::Record record) override; Shared::InteractiveCurveViewRange * interactiveCurveViewRange() override { return m_graphRange; } GraphView * functionGraphView() override { return &m_view; } diff --git a/apps/shared/function_graph_controller.cpp b/apps/shared/function_graph_controller.cpp index e68ceab32..17156f3a8 100644 --- a/apps/shared/function_graph_controller.cpp +++ b/apps/shared/function_graph_controller.cpp @@ -153,7 +153,7 @@ void FunctionGraphController::initCursorParameters() { bool FunctionGraphController::moveCursorVertically(int direction) { int currentActiveFunctionIndex = indexFunctionSelectedByCursor(); Poincare::Context * context = textFieldDelegateApp()->localContext(); - int nextActiveFunctionIndex = closestCurveIndexVertically(direction > 0, currentActiveFunctionIndex, context); + int nextActiveFunctionIndex = nextCurveIndexVertically(direction > 0, currentActiveFunctionIndex, context); if (nextActiveFunctionIndex < 0) { return false; } diff --git a/apps/shared/function_graph_controller.h b/apps/shared/function_graph_controller.h index 882990ed4..e111c4234 100644 --- a/apps/shared/function_graph_controller.h +++ b/apps/shared/function_graph_controller.h @@ -29,6 +29,9 @@ protected: virtual FunctionStore * functionStore() const; // Closest vertical curve helper + virtual int nextCurveIndexVertically(bool goingUp, int currentSelectedCurve, Poincare::Context * context) const { + return closestCurveIndexVertically(goingUp, currentSelectedCurve, context); + } bool closestCurveIndexIsSuitable(int newIndex, int currentIndex) const override; int selectedCurveIndex() const override { return *m_indexFunctionSelectedByCursor; } Poincare::Coordinate2D xyValues(int curveIndex, double t, Poincare::Context * context) const override; diff --git a/apps/shared/interactive_curve_view_controller.h b/apps/shared/interactive_curve_view_controller.h index d4c3d9354..326defd8c 100644 --- a/apps/shared/interactive_curve_view_controller.h +++ b/apps/shared/interactive_curve_view_controller.h @@ -42,7 +42,7 @@ protected: bool isCursorVisible(); // Closest vertical curve helper - virtual int closestCurveIndexVertically(bool goingUp, int currentSelectedCurve, Poincare::Context * context) const; + int closestCurveIndexVertically(bool goingUp, int currentSelectedCurve, Poincare::Context * context) const; virtual bool closestCurveIndexIsSuitable(int newIndex, int currentIndex) const = 0; virtual int selectedCurveIndex() const = 0; virtual Poincare::Coordinate2D xyValues(int curveIndex, double t, Poincare::Context * context) const = 0;