[shared] Remove angleUnitVersion

The angleUnitVersion check is no longer needed, as changing the angle
unit with a trigonometric function set would leave the cursor hanging.

Change-Id: I17d99c05daeacfec953865158cdfe7706635cd32
This commit is contained in:
Gabriel Ozouf
2020-11-16 12:26:56 +01:00
committed by EmilieNumworks
parent 5e679b7bc8
commit 56e03aae0c
10 changed files with 12 additions and 21 deletions

View File

@@ -7,8 +7,7 @@ namespace Shared {
FunctionApp::Snapshot::Snapshot() :
m_cursor(),
m_indexFunctionSelectedByCursor(0),
m_rangeVersion(0),
m_angleUnitVersion(Preferences::AngleUnit::Radian)
m_rangeVersion(0)
{
}

View File

@@ -17,7 +17,6 @@ public:
Snapshot();
CurveViewCursor * cursor() { return &m_cursor; }
uint32_t * rangeVersion() { return &m_rangeVersion; }
Poincare::Preferences::AngleUnit * angleUnitVersion() { return &m_angleUnitVersion; }
virtual FunctionStore * functionStore() = 0;
int * indexFunctionSelectedByCursor() { return &m_indexFunctionSelectedByCursor; }
void reset() override;
@@ -27,7 +26,6 @@ public:
private:
int m_indexFunctionSelectedByCursor;
uint32_t m_rangeVersion;
Poincare::Preferences::AngleUnit m_angleUnitVersion;
};
static FunctionApp * app() {
return static_cast<FunctionApp *>(Container::activeApp());

View File

@@ -11,9 +11,8 @@ using namespace Poincare;
namespace Shared {
FunctionGraphController::FunctionGraphController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, ButtonRowController * header, InteractiveCurveViewRange * interactiveRange, CurveView * curveView, CurveViewCursor * cursor, int * indexFunctionSelectedByCursor, uint32_t * rangeVersion, Preferences::AngleUnit * angleUnitVersion) :
FunctionGraphController::FunctionGraphController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, ButtonRowController * header, InteractiveCurveViewRange * interactiveRange, CurveView * curveView, CurveViewCursor * cursor, int * indexFunctionSelectedByCursor, uint32_t * rangeVersion) :
InteractiveCurveViewController(parentResponder, inputEventHandlerDelegate, header, interactiveRange, curveView, cursor, rangeVersion),
m_angleUnitVersion(angleUnitVersion),
m_indexFunctionSelectedByCursor(indexFunctionSelectedByCursor)
{
}
@@ -42,11 +41,7 @@ void FunctionGraphController::viewWillAppear() {
if (functionGraphView()->context() == nullptr) {
functionGraphView()->setContext(textFieldDelegateApp()->localContext());
}
Preferences::AngleUnit newAngleUnitVersion = Preferences::sharedPreferences()->angleUnit();
if (*m_angleUnitVersion != newAngleUnitVersion) {
*m_angleUnitVersion = newAngleUnitVersion;
initCursorParameters();
}
InteractiveCurveViewController::viewWillAppear();
}

View File

@@ -12,7 +12,7 @@ namespace Shared {
class FunctionGraphController : public InteractiveCurveViewController, public FunctionBannerDelegate {
public:
FunctionGraphController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, ButtonRowController * header, InteractiveCurveViewRange * interactiveRange, CurveView * curveView, CurveViewCursor * cursor, int * indexFunctionSelectedByCursor, uint32_t * rangeVersion, Poincare::Preferences::AngleUnit * angleUnitVersion);
FunctionGraphController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, ButtonRowController * header, InteractiveCurveViewRange * interactiveRange, CurveView * curveView, CurveViewCursor * cursor, int * indexFunctionSelectedByCursor, uint32_t * rangeVersion);
bool isEmpty() const override;
void didBecomeFirstResponder() override;
void viewWillAppear() override;
@@ -50,7 +50,6 @@ private:
bool moveCursorVertically(int direction) override;
uint32_t rangeVersion() override;
Poincare::Preferences::AngleUnit * m_angleUnitVersion;
int * m_indexFunctionSelectedByCursor;
};