Fixed horizontal zoom in audio

Originally committed to SVN as r161.
This commit is contained in:
Rodrigo Braz Monteiro 2006-02-25 00:11:54 +00:00
parent 718cfb17f1
commit 01d0916b2a
1 changed files with 3 additions and 0 deletions

View File

@ -692,12 +692,15 @@ void AudioDisplay::SetSamplesPercent(int percent,bool update,float pivot) {
if (update) {
// Center scroll
int oldSamples = samples;
UpdateSamples();
PositionSample += (oldSamples-samples)*w*pivot;
if (PositionSample < 0) PositionSample = 0;
// Update
UpdateSamples();
UpdateScrollbar();
UpdateImage();
Refresh(false);
}
}