[apps/grah} closestCurveIndexVertically renamed as next...

This commit is contained in:
Léa Saviot
2019-09-23 12:07:51 +02:00
committed by EmilieNumworks
parent 936b624fb9
commit ebfa251db8
5 changed files with 8 additions and 5 deletions

View File

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

View File

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

View File

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

View File

@@ -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<double> xyValues(int curveIndex, double t, Poincare::Context * context) const override;

View File

@@ -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<double> xyValues(int curveIndex, double t, Poincare::Context * context) const = 0;