From 919a4ec702dea1d42609e5f008498ce431e28660 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 18 Sep 2019 23:58:48 +0200 Subject: [PATCH] Fix drawing wxBitmap with mask Under wxGTK+2, when wxBitmap has a wxMask but this mask shouldn't be used in the actual drawing (useMask parameter in wxDC::DrawBitmap() is set to false), we need to get bitmap data from the buffer with raw (original, non-masked) data and not from the buffer containing data with mask applied. Close #18498. --- src/gtk/dcclient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index dc3331cc3e..c4ec6109cf 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -1155,7 +1155,7 @@ void wxWindowDCImpl::DoDrawBitmap( const wxBitmap &bitmap, } } else if (hasAlpha || pixmap == NULL) - pixbuf = bitmap.GetPixbuf(); + pixbuf = useMask ? bitmap.GetPixbuf() : bitmap.GetPixbufNoMask(); if (isScaled) {