[apps/shared] Fix InteractiveCurveViewController::moveCursorVertically

for Sequence and Regression (add a TODO for Graph)
This commit is contained in:
Émilie Feral
2019-08-30 14:49:11 +02:00
parent 8b7e243d2d
commit 2d5b60640d
3 changed files with 4 additions and 8 deletions

View File

@@ -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; }

View File

@@ -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<double> cursorPosition = xyValues(nextActiveFunctionIndex, m_cursor->x(), context);
m_cursor->moveTo(cursorPosition.x1(), cursorPosition.x1(), cursorPosition.x2());
return true;
#endif
}
CurveView * FunctionGraphController::curveView() {

View File

@@ -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() {