Remove assert checking bitmap size in wxMenuItem drawing code in wxMSW.
This assert was fatal, as usual when asserting from a WM_PAINT handler, as the function was reentered resulting in nested asserts and program abort, so remove it to at least let the program continue to run even if there is not enough space for the bitmap in the menu. There is, of course, still something wrong with the menu geometry calculations if this happens but I can't even reproduce this any more so not sure what exactly. See #11657. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
2c2138e937
commit
8087e6c942
@ -1072,9 +1072,6 @@ bool wxMenuItem::OnDrawItem(wxDC& dc, const wxRect& rc,
|
||||
int nBmpWidth = bmp.GetWidth(),
|
||||
nBmpHeight = bmp.GetHeight();
|
||||
|
||||
// there should be enough space!
|
||||
wxASSERT( nBmpWidth <= imgWidth && nBmpHeight <= (rcImg.bottom - rcImg.top) );
|
||||
|
||||
int x = rcImg.left + (imgWidth - nBmpWidth) / 2;
|
||||
int y = rcImg.top + (rcImg.bottom - rcImg.top - nBmpHeight) / 2;
|
||||
dc.Blit(x, y, nBmpWidth, nBmpHeight, &dcMem, 0, 0, wxCOPY, true);
|
||||
|
Loading…
Reference in New Issue
Block a user