From: Václav Slavík Date: Fri, 4 Jun 2004 15:57:04 +0000 (+0000) Subject: GdkColor<->wxColour values conversion is not dependent on size of integer types,... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3b9faf4c54ca224459491845be8af3edddd7e00e GdkColor<->wxColour values conversion is not dependent on size of integer types, values range is specified git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27624 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/colour.cpp b/src/gtk/colour.cpp index 98946e1649..ebb55bb7b0 100644 --- a/src/gtk/colour.cpp +++ b/src/gtk/colour.cpp @@ -146,7 +146,8 @@ void wxColourRefData::AllocColour( GdkColormap *cmap ) #define M_COLDATA ((wxColourRefData *)m_refData) -#define SHIFT (8*(sizeof(short int)-sizeof(char))) +// GDK's values are in 0..65535 range, our are in 0..255 +#define SHIFT 8 IMPLEMENT_DYNAMIC_CLASS(wxColour,wxGDIObject) diff --git a/src/gtk1/colour.cpp b/src/gtk1/colour.cpp index 98946e1649..ebb55bb7b0 100644 --- a/src/gtk1/colour.cpp +++ b/src/gtk1/colour.cpp @@ -146,7 +146,8 @@ void wxColourRefData::AllocColour( GdkColormap *cmap ) #define M_COLDATA ((wxColourRefData *)m_refData) -#define SHIFT (8*(sizeof(short int)-sizeof(char))) +// GDK's values are in 0..65535 range, our are in 0..255 +#define SHIFT 8 IMPLEMENT_DYNAMIC_CLASS(wxColour,wxGDIObject)