From 56240d61bb50e14f3bcdf86d1e4d7ed09887aa0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 29 Nov 2016 16:21:42 +0100 Subject: [PATCH] [apps/graph/graph] initialize the graph view context when the graph controller is the first responder Change-Id: I12c7b2c28e750cd49ef59de59c659a349dd0a346 --- apps/graph/graph/graph_controller.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/graph/graph/graph_controller.cpp b/apps/graph/graph/graph_controller.cpp index 86fb544c2..de1b39db3 100644 --- a/apps/graph/graph/graph_controller.cpp +++ b/apps/graph/graph/graph_controller.cpp @@ -33,10 +33,6 @@ GraphController::GraphController(Responder * parentResponder, FunctionStore * fu } View * GraphController::view() { - if (m_view.context() == nullptr) { - App * graphApp = (Graph::App *)app(); - m_view.setContext(graphApp->evaluateContext()); - } return &m_view; } @@ -101,6 +97,10 @@ Button * GraphController::buttonAtIndex(int index) { } void GraphController::didBecomeFirstResponder() { + if (m_view.context() == nullptr) { + App * graphApp = (Graph::App *)app(); + m_view.setContext(graphApp->evaluateContext()); + } if (m_axisInterval.context() == nullptr) { App * graphApp = (Graph::App *)app(); m_axisInterval.setContext(graphApp->evaluateContext());