mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-24 00:00:06 +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:
parent
b5af4d6120
commit
a866701d7e
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user