diff --git a/apps/curve_view.h b/apps/curve_view.h index c34cd7809..d859b9547 100644 --- a/apps/curve_view.h +++ b/apps/curve_view.h @@ -26,21 +26,13 @@ public: protected: void setCurveViewRange(CurveViewRange * curveViewRange); - // Drawing methods constexpr static KDColor k_axisColor = KDColor::RGB24(0x000000); constexpr static KDColor k_gridColor = KDColor::RGB24(0xEEEEEE); constexpr static KDCoordinate k_labelMargin = 4; - constexpr static int k_maxNumberOfXLabels = 18; - constexpr static int k_maxNumberOfYLabels = 13; + constexpr static int k_maxNumberOfXLabels = CurveViewRange::k_maxNumberOfXGridUnits; + constexpr static int k_maxNumberOfYLabels = CurveViewRange::k_maxNumberOfYGridUnits; constexpr static KDCoordinate k_cursorSize = 9; - /* The window bounds are deduced from the model bounds but also take into - account a margin (computed with k_marginFactor) */ - float min(Axis axis) const; - float max(Axis axis) const; - float gridUnit(Axis axis) const; - virtual char * label(Axis axis, int index) const = 0; - KDCoordinate pixelLength(Axis axis) const; float pixelToFloat(Axis axis, KDCoordinate p) const; float floatToPixel(Axis axis, float f) const; void drawLine(KDContext * ctx, KDRect rect, Axis axis, @@ -60,6 +52,13 @@ protected: private: constexpr static int k_externRectMargin = 1; + /* The window bounds are deduced from the model bounds but also take into + account a margin (computed with k_marginFactor) */ + float min(Axis axis) const; + float max(Axis axis) const; + float gridUnit(Axis axis) const; + KDCoordinate pixelLength(Axis axis) const; + virtual char * label(Axis axis, int index) const = 0; int numberOfLabels(Axis axis) const; virtual float evaluateModelWithParameter(Model * curve, float t) const; /* Recursively join two dots (dichotomy). The method stops when the diff --git a/apps/curve_view_cursor.h b/apps/curve_view_cursor.h index d66139d30..fc384a55c 100644 --- a/apps/curve_view_cursor.h +++ b/apps/curve_view_cursor.h @@ -8,7 +8,7 @@ public: float x(); float y(); void moveTo(float x, float y); -protected: +private: float m_x; float m_y; }; diff --git a/apps/curve_view_range.h b/apps/curve_view_range.h index f2b8804d4..514af2a63 100644 --- a/apps/curve_view_range.h +++ b/apps/curve_view_range.h @@ -14,11 +14,11 @@ public: virtual float xGridUnit() = 0; virtual float yGridUnit(); float computeGridUnit(Axis axis, float min, float max); -protected: - constexpr static float k_minNumberOfXGridUnits = 7.0f; constexpr static float k_maxNumberOfXGridUnits = 18.0f; - constexpr static float k_minNumberOfYGridUnits = 5.0f; constexpr static float k_maxNumberOfYGridUnits = 13.0f; +private: + constexpr static float k_minNumberOfXGridUnits = 7.0f; + constexpr static float k_minNumberOfYGridUnits = 5.0f; constexpr static float k_oneUnit = 1.0f; constexpr static float k_twoUnit = 2.0f; constexpr static float k_fiveUnit = 5.0f; diff --git a/apps/editable_cell_table_view_controller.h b/apps/editable_cell_table_view_controller.h index 1b8a2a2aa..a7e098f88 100644 --- a/apps/editable_cell_table_view_controller.h +++ b/apps/editable_cell_table_view_controller.h @@ -21,13 +21,14 @@ public: void didBecomeFirstResponder() override; protected: + SelectableTableView m_selectableTableView; +private: static constexpr KDCoordinate k_cellHeight = 30; virtual bool cellAtLocationIsEditable(int columnIndex, int rowIndex) = 0; virtual void setDataAtLocation(float floatBody, int columnIndex, int rowIndex) = 0; virtual float dataAtLocation(int columnIndex, int rowIndex) = 0; virtual int numberOfElements() = 0; virtual int maxNumberOfElements() const = 0; - SelectableTableView m_selectableTableView; }; #endif diff --git a/apps/interactive_curve_view_range.h b/apps/interactive_curve_view_range.h index cb6981626..42072b3ad 100644 --- a/apps/interactive_curve_view_range.h +++ b/apps/interactive_curve_view_range.h @@ -41,7 +41,6 @@ public: constexpr static float k_numberOfCursorStepsInGradUnit = 5.0f; protected: constexpr static float k_cursorMarginFactorToBorder = 0.025f; - bool panToMakePointVisible(float x, float y, float xMargin, float yMargin); // Window bounds of the data float m_xMin; float m_xMax; @@ -50,6 +49,8 @@ protected: bool m_yAuto; float m_xGridUnit; float m_yGridUnit; +private: + bool panToMakePointVisible(float x, float y, float xMargin, float yMargin); CurveViewCursor * m_cursor; InteractiveCurveViewRangeDelegate * m_delegate; };