From 07bc0a91b06c8483861e3c98f270e2c8adeef5d3 Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Tue, 25 Nov 2008 01:49:17 +0000 Subject: [PATCH] Fixed audio display's slowness. Originally committed to SVN as r2488. --- aegisub/audio_display.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aegisub/audio_display.cpp b/aegisub/audio_display.cpp index dfe07aab3..2120f98ba 100644 --- a/aegisub/audio_display.cpp +++ b/aegisub/audio_display.cpp @@ -104,6 +104,7 @@ AudioDisplay::AudioDisplay(wxWindow *parent) samples = 0; hasFocus = (wxWindow::FindFocus() == this); needImageUpdate = false; + needImageUpdateWeak = true; // Init UpdateTimer.SetOwner(this,Audio_Update_Timer); @@ -165,7 +166,9 @@ void AudioDisplay::UpdateImage(bool weak) { // Set image as needing to be redrawn needImageUpdate = true; - if (needImageUpdateWeak) needImageUpdateWeak = weak; + if (weak == false && needImageUpdateWeak == true) { + needImageUpdateWeak = false; + } Refresh(false); } @@ -385,7 +388,7 @@ void AudioDisplay::DoUpdateImage() { // Done needImageUpdate = false; - needImageUpdateWeak = false; + needImageUpdateWeak = true; }