Don't assert for unsupported logical functions in wxGCDC

wxGCDC is often used from wxEVT_PAINT handler and showing an assert
dialog from any of its methods results in wxEVT_PAINT being generated
again, resulting in another assert and abort, which is not useful, so
remove this assert to at least avoid crashes whenever unsupported
logical function is used, as it happens e.g. in the "Mask Screen" of our
own drawing sample.
This commit is contained in:
Vadim Zeitlin
2020-07-19 19:19:56 +02:00
parent 005b6dc88b
commit 0079e9a278

View File

@@ -1045,7 +1045,9 @@ bool wxGCDCImpl::DoStretchBlit(
wxCompositionMode mode = TranslateRasterOp(logical_func);
if ( mode == wxCOMPOSITION_INVALID )
{
wxFAIL_MSG( wxT("Blitting is not supported with this logical operation.") );
// Do *not* assert here, this function is often call from wxEVT_PAINT
// handler and asserting will just result in a reentrant call to the
// same handler and a crash.
return false;
}