Fix #598, repaint the audio display upon playback to get rid of any junk on it.

Originally committed to SVN as r3022.
This commit is contained in:
Niels Martin Hansen 2009-06-06 02:32:31 +00:00
parent 0f2d39e28f
commit d56b5b1bf6

View file

@ -1081,6 +1081,10 @@ void AudioDisplay::Play(int start,int end) {
if (end >= num_samples) end = num_samples-1; if (end >= num_samples) end = num_samples-1;
if (end < start) end = start; if (end < start) end = start;
// Redraw the image to avoid any junk left over from mouse movements etc
// See issue #598
UpdateImage(true);
// Call play // Call play
player->Play(start,end-start); player->Play(start,end-start);
wxLogDebug(_T("AudioDisplay::Play: playback started, returning")); wxLogDebug(_T("AudioDisplay::Play: playback started, returning"));
@ -1448,6 +1452,7 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
wxString text = time.GetASSFormated(); wxString text = time.GetASSFormated();
// Calculate metrics // Calculate metrics
// FIXME: Hardcoded font name
wxFont font(10,wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Verdana")); wxFont font(10,wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Verdana"));
dc.SetFont(font); dc.SetFont(font);
int tw,th; int tw,th;