diff --git a/apps/graph/graph/graph_controller.h b/apps/graph/graph/graph_controller.h index 17bb98039..ebd4bce77 100644 --- a/apps/graph/graph/graph_controller.h +++ b/apps/graph/graph/graph_controller.h @@ -27,6 +27,7 @@ private: BannerView * bannerView() override { return &m_bannerView; } void reloadBannerView() override; bool moveCursorHorizontally(int direction) override; + bool moveCursorVertically(int direction) override { return false; } // TODO Emilie Shared::InteractiveCurveViewRange * interactiveCurveViewRange() override { return m_graphRange; } GraphView * functionGraphView() override { return &m_view; } CurveParameterController * curveParameterController() override { return &m_curveParameterController; } diff --git a/apps/shared/function_graph_controller.cpp b/apps/shared/function_graph_controller.cpp index 5e702a24e..3246af89d 100644 --- a/apps/shared/function_graph_controller.cpp +++ b/apps/shared/function_graph_controller.cpp @@ -148,8 +148,6 @@ void FunctionGraphController::initCursorParameters() { } bool FunctionGraphController::moveCursorVertically(int direction) { - return false; //TODO LEA -#if 0 int currentActiveFunctionIndex = indexFunctionSelectedByCursor(); Poincare::Context * context = textFieldDelegateApp()->localContext(); int nextActiveFunctionIndex = InteractiveCurveViewController::closestCurveIndexVertically(direction > 0, currentActiveFunctionIndex, context); @@ -157,9 +155,9 @@ bool FunctionGraphController::moveCursorVertically(int direction) { return false; } selectFunctionWithCursor(nextActiveFunctionIndex); - m_cursor->moveTo(m_cursor->x(), yValue(nextActiveFunctionIndex, m_cursor->x(), context)); + Poincare::Coordinate2D cursorPosition = xyValues(nextActiveFunctionIndex, m_cursor->x(), context); + m_cursor->moveTo(cursorPosition.x1(), cursorPosition.x1(), cursorPosition.x2()); return true; -#endif } CurveView * FunctionGraphController::curveView() { diff --git a/apps/shared/interactive_curve_view_controller.cpp b/apps/shared/interactive_curve_view_controller.cpp index b6abb5671..856c74c9e 100644 --- a/apps/shared/interactive_curve_view_controller.cpp +++ b/apps/shared/interactive_curve_view_controller.cpp @@ -221,8 +221,6 @@ bool InteractiveCurveViewController::isCursorVisible() { } int InteractiveCurveViewController::closestCurveIndexVertically(bool goingUp, int currentCurveIndex, Poincare::Context * context) const { - return 0; //TODO LEA -#if 0 double x = m_cursor->x(); double y = m_cursor->y(); double nextY = goingUp ? DBL_MAX : -DBL_MAX; @@ -232,7 +230,7 @@ int InteractiveCurveViewController::closestCurveIndexVertically(bool goingUp, in if (!closestCurveIndexIsSuitable(i, currentCurveIndex)) { continue; } - double newY = yValue(i, x, context); + double newY = xyValues(i, x, context).x2(); if (!suitableYValue(newY)) { continue; } @@ -275,7 +273,6 @@ int InteractiveCurveViewController::closestCurveIndexVertically(bool goingUp, in } } return nextCurveIndex; -#endif } float InteractiveCurveViewController::cursorBottomMarginRatio() {