Files
Upsilon/apps/shared/function_graph_view.cpp
Émilie Feral 0f987ebdc5 [apps] Fix uninitialized variables
Change-Id: Ia8a218786028d8e8da7faf6b17313fc160d0f264
2017-05-09 15:08:31 +02:00

40 lines
1021 B
C++

#include "function_graph_view.h"
#include <assert.h>
#include <math.h>
#include <float.h>
using namespace Poincare;
namespace Shared {
FunctionGraphView::FunctionGraphView(InteractiveCurveViewRange * graphRange,
CurveViewCursor * cursor, BannerView * bannerView, View * cursorView) :
CurveView(graphRange, cursor, bannerView, cursorView),
m_xLabels{},
m_yLabels{},
m_context(nullptr)
{
}
void FunctionGraphView::drawRect(KDContext * ctx, KDRect rect) const {
ctx->fillRect(rect, KDColorWhite);
drawGrid(ctx, rect);
drawAxes(ctx, rect, Axis::Horizontal);
drawAxes(ctx, rect, Axis::Vertical);
drawLabels(ctx, rect, Axis::Horizontal, true);
drawLabels(ctx, rect, Axis::Vertical, true);
}
void FunctionGraphView::setContext(Context * context) {
m_context = context;
}
Context * FunctionGraphView::context() const {
return m_context;
}
char * FunctionGraphView::label(Axis axis, int index) const {
return (axis == Axis::Horizontal ? (char *)m_xLabels[index] : (char *)m_yLabels[index]);
}
}