From b1467ae608c5ecc7425283fc58df4382da317feb Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Tue, 12 Jan 2021 23:35:19 +0100 Subject: [PATCH] Fix converting wxBitmap to wxImage on wxGTK2 wxBitmap can have both a mask and alpha channel so resulting wxImage also can have both. --- src/gtk/bitmap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index b7d883cc98..a1eb51a48e 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -883,8 +883,8 @@ wxImage wxBitmap::ConvertToImage() const if (pixmap_invert != NULL) g_object_unref(pixmap_invert); } - // convert mask, unless there is already alpha - if (GetMask() && !image.HasAlpha()) + // convert mask, even there is already alpha. Image can have both. + if ( GetMask() ) { // we hard code the mask colour for now but we could also make an // effort (and waste time) to choose a colour not present in the