]> git.saurik.com Git - wxWidgets.git/commitdiff
allow white as mask color when creating mask from mono bitmap
authorPaul Cornett <paulcor@bullseye.com>
Thu, 24 Aug 2006 04:41:45 +0000 (04:41 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Thu, 24 Aug 2006 04:41:45 +0000 (04:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40783 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/bitmap.cpp

index c5ebe0fabd2a0ef9cf4a7c0fd7da2b68a6f552b8..d6d039b893809f01c8e159bd2b578980cb6b026c 100644 (file)
@@ -109,8 +109,11 @@ bool wxMask::Create( const wxBitmap& bitmap,
     {
         GdkImage* image = gdk_drawable_get_image(bitmap.GetPixmap(), 0, 0, w, h);
         GdkColormap* colormap = gdk_image_get_colormap(image);
-        guint32 mask_pixel = 1;
-        if (colormap != NULL)
+        guint32 mask_pixel;
+        if (colormap == NULL)
+            // mono bitmap, white is pixel value 0
+            mask_pixel = guint32(colour.Red() != 255 || colour.Green() != 255 || colour.Blue() != 255);
+        else
         {
             wxColor c(colour);
             c.CalcPixel(colormap);