[apps/graph] Replace multiple pointers to evaluate context by

app()->evaluateContext()

Change-Id: I21035aa357e9d2f2c471ad5751bed59cf05cebf3
This commit is contained in:
Émilie Feral
2016-11-04 17:13:38 +01:00
parent 65465897d3
commit f4a95cb43f
8 changed files with 38 additions and 17 deletions

View File

@@ -9,7 +9,7 @@ constexpr KDColor kSecondaryGridColor = KDColor(0xEEEEEE);
constexpr int kNumberOfMainGridLines = 5;
constexpr int kNumberOfSecondaryGridLines = 4;
GraphView::GraphView(FunctionStore * functionStore, EvaluateContext * evaluateContext) :
GraphView::GraphView(FunctionStore * functionStore) :
#if GRAPH_VIEW_IS_TILED
TiledView(),
#else
@@ -22,7 +22,7 @@ GraphView::GraphView(FunctionStore * functionStore, EvaluateContext * evaluateCo
m_yMin(-2.0f),
m_yMax(2.0f),
m_functionStore(functionStore),
m_evaluateContext(evaluateContext)
m_evaluateContext(nullptr)
{
}
@@ -34,6 +34,14 @@ View * GraphView::subviewAtIndex(int index) {
return &m_cursorView;
}
void GraphView::setContext(Context * context) {
m_evaluateContext = (EvaluateContext *)context;
}
Context * GraphView::context() const {
return m_evaluateContext;
}
void GraphView::moveCursorRight() {
KDPoint offset = KDPoint(2,0);
m_cursorPosition = m_cursorPosition.translatedBy(offset);