From c433d3d0fd19ce8ba88380ee3a27645a9d51770d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Nov 2019 17:56:44 +0100 Subject: [PATCH] Use wxALPHA_XXX constants instead of 0 and 255 No real changes, just try to improve the code clarity. --- src/generic/graphicc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index 0e64c0d129..4bbca0ae54 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -1529,13 +1529,13 @@ wxCairoBitmapData::wxCairoBitmapData( wxGraphicsRenderer* renderer, const wxBitm // blue. The 32-bit quantities are stored native-endian. // Pre-multiplied alpha is used. #if defined (__WXMSW__) || defined(__WXOSX__) - unsigned char alpha = hasAlpha ? p.Alpha() : 255; + unsigned char alpha = hasAlpha ? p.Alpha() : wxALPHA_OPAQUE; // MSW and OSX bitmap pixel bits are already premultiplied. *data = (alpha << 24 | p.Red() << 16 | p.Green() << 8 | p.Blue()); #else // !__WXMSW__ , !__WXOSX__ // We always have alpha, but we need to premultiply it. unsigned char alpha = p.Alpha(); - if (alpha == 0) + if (alpha == wxALPHA_TRANSPARENT) *data = 0; else *data = (alpha << 24