mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-27 01:29:58 +01:00
[apps] In curve view range, improve constant naming
Change-Id: Ibad771a35d1130f41ef57ba323fd401ff3ea4340
This commit is contained in:
@@ -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)))) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user