diff --git a/apps/curve_view_range.cpp b/apps/curve_view_range.cpp index f85bde9cd..e5d0fffe3 100644 --- a/apps/curve_view_range.cpp +++ b/apps/curve_view_range.cpp @@ -16,7 +16,7 @@ float CurveViewRange::computeGridUnit(Axis axis, float min, float max) { maxNumberOfUnits = k_maxNumberOfYGridUnits; minNumberOfUnits = k_minNumberOfYGridUnits; } - float units[3] = {k_oneUnit, k_twoUnit, k_fiveUnit}; + float units[3] = {k_smallGridUnitMantissa, k_mediumGridUnitMantissa, k_largeGridUnitMantissa}; for (int k = 0; k < 3; k++) { float unit = units[k]; if (floorf(log10f(d/(unit*maxNumberOfUnits))) != floorf(log10f(d/(unit*minNumberOfUnits)))) { diff --git a/apps/curve_view_range.h b/apps/curve_view_range.h index 514af2a63..69d13e8b7 100644 --- a/apps/curve_view_range.h +++ b/apps/curve_view_range.h @@ -19,9 +19,12 @@ public: 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; + /* The grid units is constrained to be a number of type: k*10^n with k = 1,2 or 5 + * and n a relative integer. The choice of x and y grid units depend on the + * grid range.*/ + constexpr static float k_smallGridUnitMantissa = 1.0f; + constexpr static float k_mediumGridUnitMantissa = 2.0f; + constexpr static float k_largeGridUnitMantissa = 5.0f; }; #endif