1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-24 08:10:05 +02:00

Add some more precision to the ruler in LinearDBFormat mode, and display it. This is not a complete fix, but is some way towards it.

This commit is contained in:
martynshaw99 2013-12-06 00:51:49 +00:00
parent b5af4d6120
commit a866701d7e

View File

@ -369,6 +369,16 @@ void Ruler::FindLinearTickSizes(double UPP)
switch(mFormat) {
case LinearDBFormat:
if (units < 0.001) {
mMinor = 0.001;
mMajor = 0.005;
return;
}
if (units < 0.01) {
mMinor = 0.01;
mMajor = 0.05;
return;
}
if (units < 0.1) {
mMinor = 0.1;
mMajor = 0.5;
@ -590,7 +600,8 @@ wxString Ruler::LabelString(double d, bool major)
if (mMinor >= 1.0)
s.Printf(wxT("%d"), (int)floor(d+0.5));
else {
s.Printf(wxT("%.1f"), d);
int precision = -log10(mMinor);
s.Printf(wxT("%.*f"), precision, d);
}
break;
case RealFormat: