mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-01 14:43:48 +01: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:
@@ -763,9 +763,11 @@ void FrequencyPlotDialog::DrawPlot()
|
|||||||
int sRange = yRange * 100;
|
int sRange = yRange * 100;
|
||||||
int sPos = vPanScroller->GetThumbPosition() + ((vPanScroller->GetThumbSize() - sTotal) / 2);
|
int sPos = vPanScroller->GetThumbPosition() + ((vPanScroller->GetThumbSize() - sTotal) / 2);
|
||||||
|
|
||||||
// Set scrollbar size
|
// Set scrollbar size and position
|
||||||
vPanScroller->SetScrollbar(sPos, sTotal, sRange, sTotal);
|
vPanScroller->SetScrollbar(sPos, sTotal, sRange, sTotal);
|
||||||
|
|
||||||
|
// Recompute sPos, taking into account SetScrollbar() clamping the position.
|
||||||
|
sPos = vPanScroller->GetThumbPosition();
|
||||||
yMax = mYMax - ((float)sPos / 100);
|
yMax = mYMax - ((float)sPos / 100);
|
||||||
yMin = yMax - yTotal;
|
yMin = yMax - yTotal;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user