Don't cause assertion violations when showing Lyrics window
This commit is contained in:
parent
0b58cc7483
commit
079c268b34
|
@ -464,14 +464,18 @@ void Lyrics::OnKeyEvent(wxKeyEvent & event)
|
|||
}
|
||||
|
||||
void Lyrics::OnPaint(wxPaintEvent & WXUNUSED(event))
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
DoPaint(dc);
|
||||
}
|
||||
|
||||
void Lyrics::DoPaint(wxDC &dc)
|
||||
{
|
||||
if (!this->GetParent()->IsShown())
|
||||
return;
|
||||
|
||||
if (mLyricsStyle == kBouncingBallLyrics)
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
|
||||
if (!mMeasurementsDone)
|
||||
Measure(&dc);
|
||||
|
||||
|
@ -509,8 +513,8 @@ void Lyrics::OnSize(wxSizeEvent & WXUNUSED(event))
|
|||
if (mLyricsStyle == kBouncingBallLyrics)
|
||||
{
|
||||
mMeasurementsDone = false;
|
||||
wxPaintEvent ignore;
|
||||
this->OnPaint(ignore);
|
||||
wxClientDC dc(this);
|
||||
this->DoPaint(dc);
|
||||
}
|
||||
else // (mLyricsStyle == kHighlightLyrics)
|
||||
{
|
||||
|
|
|
@ -92,6 +92,7 @@ class Lyrics final : public wxPanelWrapper
|
|||
// Event handlers
|
||||
//
|
||||
void OnKeyEvent(wxKeyEvent & event);
|
||||
void DoPaint(wxDC &dc);
|
||||
void OnPaint(wxPaintEvent &evt);
|
||||
void OnSize(wxSizeEvent &evt);
|
||||
|
||||
|
|
Loading…
Reference in New Issue