mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/grah} closestCurveIndexVertically renamed as next...
This commit is contained in:
committed by
EmilieNumworks
parent
936b624fb9
commit
ebfa251db8
@@ -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;
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user