From 20269a58c0d8b1cefcb70562088e5f0c2299c6c4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 16 Dec 2019 15:08:35 +0100 Subject: [PATCH] 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. --- src/generic/statbmpg.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/generic/statbmpg.cpp b/src/generic/statbmpg.cpp index d355fe7181..26404a5529 100644 --- a/src/generic/statbmpg.cpp +++ b/src/generic/statbmpg.cpp @@ -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;