mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-02 15:13:50 +01:00
FreqWindow: Begin refactoring vertical zooming code
Signed-off-by: nyanpasu64 <nyanpasu64@tuta.io>
This commit is contained in:
@@ -753,16 +753,22 @@ void FrequencyPlotDialog::DrawPlot()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
float yRange = mYMax - mYMin;
|
// Compute y axis ruler range, given current zoom level
|
||||||
float yTotal = yRange * ((float) vZoomSlider->GetValue() / 100.0f);
|
float yTotal, yMax, yMin;
|
||||||
|
{
|
||||||
|
float yRange = mYMax - mYMin;
|
||||||
|
yTotal = yRange * ((float) vZoomSlider->GetValue() / 100.0f);
|
||||||
|
|
||||||
int sTotal = yTotal * 100;
|
int sTotal = yTotal * 100;
|
||||||
int sRange = yRange * 100;
|
int sRange = yRange * 100;
|
||||||
int sPos = vPanScroller->GetThumbPosition() + ((vPanScroller->GetThumbSize() - sTotal) / 2);
|
int sPos = vPanScroller->GetThumbPosition() + ((vPanScroller->GetThumbSize() - sTotal) / 2);
|
||||||
vPanScroller->SetScrollbar(sPos, sTotal, sRange, sTotal);
|
|
||||||
|
|
||||||
float yMax = mYMax - ((float)sPos / 100);
|
// Set scrollbar size
|
||||||
float yMin = yMax - yTotal;
|
vPanScroller->SetScrollbar(sPos, sTotal, sRange, sTotal);
|
||||||
|
|
||||||
|
yMax = mYMax - ((float)sPos / 100);
|
||||||
|
yMin = yMax - yTotal;
|
||||||
|
}
|
||||||
|
|
||||||
// Set up y axis ruler
|
// Set up y axis ruler
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user