[apps] In curve view range, improve constant naming

Change-Id: Ibad771a35d1130f41ef57ba323fd401ff3ea4340
This commit is contained in:
Émilie Feral
2017-01-12 16:51:41 +01:00
parent 051613d422
commit 33ba6d2fa7
2 changed files with 7 additions and 4 deletions

View File

@@ -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)))) {

View File

@@ -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