1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-30 15:49:41 +02:00

FreqWindow: Fix bug where zooming out doesn't clamp scroll until redraw

Signed-off-by: nyanpasu64 <nyanpasu64@tuta.io>
This commit is contained in:
nyanpasu64 2021-07-10 14:23:51 -07:00 committed by Be
parent 37dc454463
commit 7ac6dc175b

View File

@ -763,9 +763,11 @@ void FrequencyPlotDialog::DrawPlot()
int sRange = yRange * 100;
int sPos = vPanScroller->GetThumbPosition() + ((vPanScroller->GetThumbSize() - sTotal) / 2);
// Set scrollbar size
// Set scrollbar size and position
vPanScroller->SetScrollbar(sPos, sTotal, sRange, sTotal);
// Recompute sPos, taking into account SetScrollbar() clamping the position.
sPos = vPanScroller->GetThumbPosition();
yMax = mYMax - ((float)sPos / 100);
yMin = yMax - yTotal;
}