diff --git a/apps/graph/values/function_parameter_controller.cpp b/apps/graph/values/function_parameter_controller.cpp index 8fe4e5da3..4ddb639b0 100644 --- a/apps/graph/values/function_parameter_controller.cpp +++ b/apps/graph/values/function_parameter_controller.cpp @@ -25,9 +25,6 @@ bool FunctionParameterController::handleEvent(Ion::Events::Event event) { case 0: { m_cartesianFunction->setDisplayDerivative(!m_cartesianFunction->displayDerivative()); - if (m_cartesianFunction->displayDerivative()) { - m_valuesController->selectCellAtLocation(m_valuesController->selectedColumn()+1, m_valuesController->selectedRow()); - } m_selectableTableView.reloadData(); return true; } @@ -63,6 +60,13 @@ int FunctionParameterController::reusableCellCount() { return k_totalNumberOfCell; } +void FunctionParameterController::viewWillAppear() { + ValuesFunctionParameterController::viewWillAppear(); + if (m_cartesianFunction->displayDerivative()) { + m_valuesController->selectCellAtLocation(m_valuesController->selectedColumn()+1, m_valuesController->selectedRow()); + } +} + void FunctionParameterController::willDisplayCellForIndex(HighlightCell * cell, int index) { if (cell == &m_displayDerivativeColumn) { SwitchView * switchView = (SwitchView *)m_displayDerivativeColumn.accessoryView(); diff --git a/apps/graph/values/function_parameter_controller.h b/apps/graph/values/function_parameter_controller.h index cf39caa75..4c9f44ab9 100644 --- a/apps/graph/values/function_parameter_controller.h +++ b/apps/graph/values/function_parameter_controller.h @@ -17,6 +17,7 @@ public: int reusableCellCount() override; void willDisplayCellForIndex(HighlightCell * cell, int index) override; void setFunction(Shared::Function * function) override; + void viewWillAppear() override; private: #if COPY_COLUMN constexpr static int k_totalNumberOfCell = 2;