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:
parent
b5af4d6120
commit
a866701d7e
@ -369,6 +369,16 @@ void Ruler::FindLinearTickSizes(double UPP)
|
|||||||
|
|
||||||
switch(mFormat) {
|
switch(mFormat) {
|
||||||
case LinearDBFormat:
|
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) {
|
if (units < 0.1) {
|
||||||
mMinor = 0.1;
|
mMinor = 0.1;
|
||||||
mMajor = 0.5;
|
mMajor = 0.5;
|
||||||
@ -590,7 +600,8 @@ wxString Ruler::LabelString(double d, bool major)
|
|||||||
if (mMinor >= 1.0)
|
if (mMinor >= 1.0)
|
||||||
s.Printf(wxT("%d"), (int)floor(d+0.5));
|
s.Printf(wxT("%d"), (int)floor(d+0.5));
|
||||||
else {
|
else {
|
||||||
s.Printf(wxT("%.1f"), d);
|
int precision = -log10(mMinor);
|
||||||
|
s.Printf(wxT("%.*f"), precision, d);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RealFormat:
|
case RealFormat:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user