mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/shared] Move partial classes from grpah/graph to shared to be used
by sequence Change-Id: I0e18be96cfaa92b6a51836ae8aa072fa6cf0f1af
This commit is contained in:
37
apps/shared/function_graph_view.cpp
Normal file
37
apps/shared/function_graph_view.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#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_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]);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user