1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-11 09:31:13 +02:00

Fine tune spacing between minor ticks in rulers.

The main point of this is not to ask for overcrowded rulers.

We already handle overcrowded rulers well, by not showing the minor ticks.
This change means that we are more likely to ask for a spacing that works.
In turn that means that we are less likely to have anomalies where numbers disappear due to overcrowding and reappear again as you resize the ruler.
This commit is contained in:
James Crook 2018-04-14 15:44:56 +01:00
parent 89788d4690
commit 5120a9dfc6

View File

@ -397,9 +397,11 @@ void Ruler::FindLinearTickSizes(double UPP)
double d; double d;
// As a heuristic, we want at least 16 pixels // As a heuristic, we want at least 22 pixels between each
// between each minor tick // minor tick. We want to show numbers like "-48"
double units = 16 * fabs(UPP); // in that space.
// If vertical, we don't need as much space.
double units = ((mOrientation == wxHORIZONTAL) ? 22 : 12) * fabs(UPP);
mDigits = 0; mDigits = 0;