mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-11 17:41:15 +02:00
Bug1161: maximum zoom-out in Waveform (dB) ruler should be +6.02 dB, not +2 dB
This commit is contained in:
parent
8c75d70669
commit
78ec5cdf0b
@ -4713,15 +4713,20 @@ void TrackPanel::HandleWaveTrackVZoom
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Zoom out
|
// Zoom out
|
||||||
|
const WaveformSettings &settings = track->GetWaveformSettings();
|
||||||
|
const bool linear = settings.isLinear();
|
||||||
|
const float top = linear
|
||||||
|
? 2.0
|
||||||
|
: (LINEAR_TO_DB(2.0) + settings.dBRange) / settings.dBRange;
|
||||||
if (min <= -1.0 && max >= 1.0) {
|
if (min <= -1.0 && max >= 1.0) {
|
||||||
// Go to the maximal zoom-out
|
// Go to the maximal zoom-out
|
||||||
min = -2.0;
|
min = -top;
|
||||||
max = 2.0;
|
max = top;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// limit to +/- 1 range unless already outside that range...
|
// limit to +/- 1 range unless already outside that range...
|
||||||
float minRange = (min < -1) ? -2.0 : -1.0;
|
float minRange = (min < -1) ? -top : -1.0;
|
||||||
float maxRange = (max > 1) ? 2.0 : 1.0;
|
float maxRange = (max > 1) ? top : 1.0;
|
||||||
// and enforce vertical zoom limits.
|
// and enforce vertical zoom limits.
|
||||||
const float p1 = (zoomStart - ypos) / (float)height;
|
const float p1 = (zoomStart - ypos) / (float)height;
|
||||||
if (fixedMousePoint) {
|
if (fixedMousePoint) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user