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:
Niels Martin Hansen 2007-09-21 21:24:32 +00:00
parent 6b4ec2dcc5
commit 6587f4882a

View file

@ -1956,17 +1956,19 @@ void AudioDisplay::OnUpdateTimer(wxTimerEvent &event) {
// Draw cursor // Draw cursor
wxMemoryDC src; wxMemoryDC src;
curpos = GetXAtSample(curPos); curpos = GetXAtSample(curPos);
dc.SetPen(wxPen(Options.AsColour(_T("Audio Play cursor")))); if (curpos >= 0 && curpos < GetClientSize().GetWidth()) {
src.SelectObject(*origImage); dc.SetPen(wxPen(Options.AsColour(_T("Audio Play cursor"))));
if (fullDraw) { src.SelectObject(*origImage);
//dc.Blit(0,0,w,h,&src,0,0); if (fullDraw) {
dc.DrawLine(curpos,0,curpos,h); //dc.Blit(0,0,w,h,&src,0,0);
//dc.Blit(0,0,curpos-10,h,&src,0,0); dc.DrawLine(curpos,0,curpos,h);
//dc.Blit(curpos+10,0,w-curpos-10,h,&src,curpos+10,0); //dc.Blit(0,0,curpos-10,h,&src,0,0);
} //dc.Blit(curpos+10,0,w-curpos-10,h,&src,curpos+10,0);
else { }
dc.Blit(oldCurPos,0,1,h,&src,oldCurPos,0); else {
dc.DrawLine(curpos,0,curpos,h); dc.Blit(oldCurPos,0,1,h,&src,oldCurPos,0);
dc.DrawLine(curpos,0,curpos,h);
}
} }
} }
else { else {