[apps/sequence] Create a class curve view range

Change-Id: I72786a6efb6379604634abae63eb93ba758691a4
This commit is contained in:
Émilie Feral
2017-02-23 09:35:32 +01:00
parent ff648cd0f1
commit 5600e52014
3 changed files with 39 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
app_objs += $(addprefix apps/sequence/,\
app.o\
graph/banner_view.o\
graph/curve_view_range.o\
graph/graph_view.o\
list/list_controller.o\
list/list_parameter_controller.o\

View File

@@ -0,0 +1,20 @@
#include "curve_view_range.h"
using namespace Shared;
namespace Sequence {
CurveViewRange::CurveViewRange(CurveViewCursor * cursor, InteractiveCurveViewRangeDelegate * delegate) :
InteractiveCurveViewRange(cursor, delegate)
{
m_xMin = -k_displayLeftMarginRatio*m_xMax;
}
void CurveViewRange::setDefault() {
m_xMax = 10.0f;
m_xMin = -k_displayLeftMarginRatio*m_xMax;
m_xGridUnit = computeGridUnit(Axis::X, m_xMin, m_xMax);
setYAuto(true);
}
}

View File

@@ -0,0 +1,18 @@
#ifndef SEQUENCE_CURVE_VIEW_RANGE_H
#define SEQUENCE_CURVE_VIEW_RANGE_H
#include "../../shared/interactive_curve_view_range.h"
namespace Sequence {
class CurveViewRange : public Shared::InteractiveCurveViewRange {
public:
CurveViewRange(Shared::CurveViewCursor * cursor, Shared::InteractiveCurveViewRangeDelegate * delegate);
void setDefault() override;
private:
constexpr static float k_displayLeftMarginRatio = 0.05f;
};
}
#endif