mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 05:40:38 +01:00
[apps/shared] Correct cursor initialisation in graph view in graph and
regression Change-Id: I76bc1960f9633de825ae0efa49b9e057cd092f57
This commit is contained in:
@@ -45,6 +45,11 @@ void GraphController::viewWillAppear() {
|
||||
App * graphApp = (Graph::App *)app();
|
||||
m_view.setContext(graphApp->localContext());
|
||||
}
|
||||
Expression::AngleUnit newAngleUnitVersion = Preferences::sharedPreferences()->angleUnit();
|
||||
if (m_angleUnitVersion != newAngleUnitVersion) {
|
||||
m_angleUnitVersion = newAngleUnitVersion;
|
||||
initCursorParameters();
|
||||
}
|
||||
InteractiveCurveViewController::viewWillAppear();
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ private:
|
||||
CurveParameterController m_curveParameterController;
|
||||
CartesianFunctionStore * m_functionStore;
|
||||
int m_indexFunctionSelectedByCursor;
|
||||
Poincare::Expression::AngleUnit m_angleUnitVersion;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -103,7 +103,10 @@ void InteractiveCurveViewController::didBecomeFirstResponder() {
|
||||
if (m_modelVersion != newModelVersion) {
|
||||
m_modelVersion = newModelVersion;
|
||||
initRangeParameters();
|
||||
/* Warning: init cursor parameter before reloading banner view. Indeed,
|
||||
* reloading banner view needs an updated cursor to load the right data. */
|
||||
initCursorParameters();
|
||||
centerCursorVertically();
|
||||
reloadBannerView();
|
||||
curveView()->reload();
|
||||
}
|
||||
@@ -146,9 +149,6 @@ Responder * InteractiveCurveViewController::defaultController() {
|
||||
void InteractiveCurveViewController::viewWillAppear() {
|
||||
curveView()->selectMainView(true);
|
||||
headerViewController()->setSelectedButton(-1);
|
||||
/* Warning: init cursor parameter before reloading banner view. Indeed,
|
||||
* reloading banner view needs an updated cursor to load the right data. */
|
||||
initCursorParameters();
|
||||
reloadBannerView();
|
||||
curveView()->reload();
|
||||
}
|
||||
@@ -161,4 +161,9 @@ StackViewController * InteractiveCurveViewController::stackController() const{
|
||||
return (StackViewController *)(parentResponder()->parentResponder()->parentResponder());
|
||||
}
|
||||
|
||||
void InteractiveCurveViewController::centerCursorVertically() {
|
||||
if (!interactiveCurveViewRange()->yAuto()) {
|
||||
interactiveCurveViewRange()->centerAxisAround(CurveViewRange::Axis::Y, m_cursor.y());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ protected:
|
||||
virtual bool handleEnter() = 0;
|
||||
Responder * tabController() const;
|
||||
StackViewController * stackController() const;
|
||||
void centerCursorVertically();
|
||||
virtual void reloadBannerView() = 0;
|
||||
virtual void initRangeParameters() = 0;
|
||||
virtual void initCursorParameters() = 0;
|
||||
|
||||
Reference in New Issue
Block a user