1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-23 15:50:05 +02:00

Bug 1867 - Jumping numbers on meter resizing

They jumped because of overcrowding.  Now when overcrowded, don't show
any minor numbers.
This commit is contained in:
James Crook 2018-04-13 19:26:56 +01:00
parent 6d96ec1e52
commit 8344a2bae9

View File

@ -1138,6 +1138,7 @@ void Ruler::Update(const TimeTrack* timetrack)// Envelope *speedEnv, long minSpe
double sg = UPP > 0.0? 1.0: -1.0; double sg = UPP > 0.0? 1.0: -1.0;
int nDroppedMinorLabels=0;
// Major and minor ticks // Major and minor ticks
for (int jj = 0; jj < 2; ++jj) { for (int jj = 0; jj < 2; ++jj) {
const double denom = jj == 0 ? mMajor : mMinor; const double denom = jj == 0 ? mMajor : mMinor;
@ -1181,8 +1182,15 @@ void Ruler::Update(const TimeTrack* timetrack)// Envelope *speedEnv, long minSpe
step = floor(sg * warpedD / denom); step = floor(sg * warpedD / denom);
bool major = jj == 0; bool major = jj == 0;
Tick(i, sg * step * denom, major, !major); Tick(i, sg * step * denom, major, !major);
if( !major && mMinorLabels[mNumMinor-1].lx < mLeft )
nDroppedMinorLabels++;
} }
} }
// If we've dropped minor labels through overcrowding, then don't show
// any of them. We're allowed though to drop ones which correspond to the
// major numbers.
if( nDroppedMinorLabels > mNumMajor )
mNumMinor = 0;
} }
// Left and Right Edges // Left and Right Edges