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:
Vadim Zeitlin
2019-12-16 15:08:35 +01:00
parent b16a1453af
commit 20269a58c0

View File

@@ -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;