]> git.saurik.com Git - wxWidgets.git/commitdiff
avoid truncating the colour channels values, this results in warnings when using...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 11 May 2007 22:28:17 +0000 (22:28 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 11 May 2007 22:28:17 +0000 (22:28 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45975 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/colour.h

index 9c3cea2c90bb6559a2b2e888ec312b6ae89bf661..20b673b39a07acf3625c3b40a7f653e30f37c21b 100644 (file)
@@ -84,9 +84,9 @@ public:
     {
         // we don't need to know sizeof(long) here because we assume that the three
         // least significant bytes contain the R, G and B values
-        Set((ChannelType)colRGB,
-            (ChannelType)(colRGB >> 8),
-            (ChannelType)(colRGB >> 16));
+        Set((ChannelType)(0xFF & colRGB),
+            (ChannelType)(0xFF & (colRGB >> 8)),
+            (ChannelType)(0xFF & (colRGB >> 16)));
     }