From 5f1a951b006ead3ba92c8b0453bf0001367b4719 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 11 May 2007 22:41:50 +0000 Subject: [PATCH] avoid truncating the colour channels values, this results in warnings when using VC8 debug CRT (patch 1717288) [backport from HEAD] git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@45981 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/colour.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/wx/colour.h b/include/wx/colour.h index 9c3cea2c90..20b673b39a 100644 --- a/include/wx/colour.h +++ b/include/wx/colour.h @@ -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))); }