Avoid spurious assert failures in wxGenericStaticBitmap
Don't trigger a confusing assertion failure about unknown scale mode if a 0-sized window is being repainted. It's not clear why should an empty window get repaint events in the first place, but this does happen, at least under MSW, so guard against it.
This commit is contained in:
@@ -46,6 +46,9 @@ void wxGenericStaticBitmap::OnPaint(wxPaintEvent& WXUNUSED(event))
|
||||
|
||||
wxPaintDC dc(this);
|
||||
const wxSize drawSize = GetClientSize();
|
||||
if ( !drawSize.x || !drawSize.y )
|
||||
return;
|
||||
|
||||
const wxSize bmpSize = m_bitmap.GetSize();
|
||||
wxDouble w = 0;
|
||||
wxDouble h = 0;
|
||||
|
Reference in New Issue
Block a user