[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] MDI resize assertion failure
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] MDI resize assertion failure |
Date: |
Sun, 21 Jun 2015 15:42:56 +0200 |
On Sun, 21 Jun 2015 02:16:41 +0000 Greg Chicares <address@hidden> wrote:
GC> Symptom:
GC>
GC> Error
GC> Assertion '"w > 0 && h > 0"' failed
GC> (invalid bitmap size).
GC> [file ../src/msw/bitmap.cpp, line 758]
GC>
GC> To reproduce (at least with msw-xp):
GC>
GC> File | New | Illustration | OK
GC> alt-hyphen-X [or click the MDI child's maximize box]
GC> resize the application to the "wrong" size
Thank you for the detailed instructions, I had no trouble reproducing the
bug thanks to them.
GC> I speculate that it's an MDI thing
Actually for once MDI is blameless and the bug is in wxHtmlWindow used for
displaying the illustration: it tries to create a bitmap of 0 size which is
not allowed in wxMSW neither now (it used to behave differently in
different ports, see http://trac.wxwidgets.org/ticket/16828). I've fixed it
now in
https://github.com/wxWidgets/wxWidgets/commit/bede8a3296431f7883c37140e5047c43636b7289
which is reproduced here for your convenience:
---------------------------------- >8 --------------------------------------
diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp
index a92a4c1..d783a3e 100644
--- a/src/html/htmlwin.cpp
+++ b/src/html/htmlwin.cpp
@@ -1148,6 +1148,10 @@ void wxHtmlWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
const wxRect rect = GetUpdateRegion().GetBox();
const wxSize sz = GetClientSize();
+ // Don't bother drawing the empty window.
+ if ( sz.x == 0 || sz.y == 0 )
+ return;
+
// set up the DC we're drawing on: if the window is already double buffered
// we do it directly on wxPaintDC, otherwise we allocate a backing store
// buffer and compose the drawing there and then blit it to screen all at
---------------------------------- >8 --------------------------------------
Unfortunately I don't think there is any way to work around this bug
without this change to wxWidgets itself, so you will have to upgrade once
again to get rid of it.
Thanks again for reporting this!
VZ