Fix crash when playback cursor leaves the visible part of the audio display on wxMac.
Originally committed to SVN as r1572.
This commit is contained in:
parent
6b4ec2dcc5
commit
6587f4882a
1 changed files with 13 additions and 11 deletions
|
@ -1956,6 +1956,7 @@ void AudioDisplay::OnUpdateTimer(wxTimerEvent &event) {
|
||||||
// Draw cursor
|
// Draw cursor
|
||||||
wxMemoryDC src;
|
wxMemoryDC src;
|
||||||
curpos = GetXAtSample(curPos);
|
curpos = GetXAtSample(curPos);
|
||||||
|
if (curpos >= 0 && curpos < GetClientSize().GetWidth()) {
|
||||||
dc.SetPen(wxPen(Options.AsColour(_T("Audio Play cursor"))));
|
dc.SetPen(wxPen(Options.AsColour(_T("Audio Play cursor"))));
|
||||||
src.SelectObject(*origImage);
|
src.SelectObject(*origImage);
|
||||||
if (fullDraw) {
|
if (fullDraw) {
|
||||||
|
@ -1969,6 +1970,7 @@ void AudioDisplay::OnUpdateTimer(wxTimerEvent &event) {
|
||||||
dc.DrawLine(curpos,0,curpos,h);
|
dc.DrawLine(curpos,0,curpos,h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
if (curPos > player->GetEndPosition() + 8192) {
|
if (curPos > player->GetEndPosition() + 8192) {
|
||||||
player->Stop();
|
player->Stop();
|
||||||
|
|
Loading…
Reference in a new issue