mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps] Graph/Sequence: the function selected by the cursor has to be
save in the Snapshot to avoid weird selection when rebulding the app
This commit is contained in:
committed by
EmilieNumworks
parent
c9b86d0c86
commit
95f0efaf9f
@@ -6,8 +6,8 @@ using namespace Poincare;
|
||||
|
||||
namespace Sequence {
|
||||
|
||||
GraphController::GraphController(Responder * parentResponder, SequenceStore * sequenceStore, CurveViewRange * graphRange, CurveViewCursor * cursor, uint32_t * modelVersion, uint32_t * rangeVersion, Expression::AngleUnit * angleUnitVersion, ButtonRowController * header) :
|
||||
FunctionGraphController(parentResponder, header, graphRange, &m_view, cursor, modelVersion, rangeVersion, angleUnitVersion),
|
||||
GraphController::GraphController(Responder * parentResponder, SequenceStore * sequenceStore, CurveViewRange * graphRange, CurveViewCursor * cursor, int * indexFunctionSelectedByCursor, uint32_t * modelVersion, uint32_t * rangeVersion, Expression::AngleUnit * angleUnitVersion, ButtonRowController * header) :
|
||||
FunctionGraphController(parentResponder, header, graphRange, &m_view, cursor, indexFunctionSelectedByCursor, modelVersion, rangeVersion, angleUnitVersion),
|
||||
m_bannerView(),
|
||||
m_view(sequenceStore, graphRange, m_cursor, &m_bannerView, &m_cursorView),
|
||||
m_graphRange(graphRange),
|
||||
@@ -34,7 +34,7 @@ BannerView * GraphController::bannerView() {
|
||||
}
|
||||
|
||||
bool GraphController::handleEnter() {
|
||||
m_termSumController.setFunction(m_sequenceStore->activeFunctionAtIndex(m_indexFunctionSelectedByCursor));
|
||||
m_termSumController.setFunction(m_sequenceStore->activeFunctionAtIndex(indexFunctionSelectedByCursor()));
|
||||
return FunctionGraphController::handleEnter();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ bool GraphController::moveCursorHorizontally(int direction) {
|
||||
if (x < 0.0) {
|
||||
return false;
|
||||
}
|
||||
Sequence * s = m_sequenceStore->activeFunctionAtIndex(m_indexFunctionSelectedByCursor);
|
||||
Sequence * s = m_sequenceStore->activeFunctionAtIndex(indexFunctionSelectedByCursor());
|
||||
TextFieldDelegateApp * myApp = (TextFieldDelegateApp *)app();
|
||||
double y = s->evaluateAtAbscissa(x, myApp->localContext());
|
||||
m_cursor->moveTo(x, y);
|
||||
@@ -63,7 +63,7 @@ bool GraphController::moveCursorHorizontally(int direction) {
|
||||
|
||||
void GraphController::initCursorParameters() {
|
||||
double x = std::round((interactiveCurveViewRange()->xMin()+interactiveCurveViewRange()->xMax())/2.0);
|
||||
m_indexFunctionSelectedByCursor = 0;
|
||||
selectFunctionWithCursor(0);
|
||||
TextFieldDelegateApp * myApp = (TextFieldDelegateApp *)app();
|
||||
int functionIndex = 0;
|
||||
double y = 0;
|
||||
|
||||
Reference in New Issue
Block a user