From 624d506b58e116aec69cef59a919c60d9cf134cd Mon Sep 17 00:00:00 2001 From: Chris Elliott Date: Mon, 22 Sep 2003 09:44:57 +0000 Subject: [PATCH] fix for gtk swapped colors git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23800 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/cursor.cpp | 11 +++++++++++ src/gtk1/cursor.cpp | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index f23daacbb9..54bd0e23a3 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -254,6 +254,17 @@ wxCursor::wxCursor( const wxImage & image ) (unsigned char)(colNextMostFreq >> 8), (unsigned char)(colNextMostFreq) ); + int fg_intensity = fg.Red() + fg.Green() + fg.Blue(); + int bg_intensity = bg.Red() + bg.Green() + bg.Blue(); + + if (bg_intensity > fg_intensity) + { + //swap fg and bg + wxColour tmp = fg; + fg = bg; + bg = tmp; + } + int hotSpotX; int hotSpotY; diff --git a/src/gtk1/cursor.cpp b/src/gtk1/cursor.cpp index f23daacbb9..54bd0e23a3 100644 --- a/src/gtk1/cursor.cpp +++ b/src/gtk1/cursor.cpp @@ -254,6 +254,17 @@ wxCursor::wxCursor( const wxImage & image ) (unsigned char)(colNextMostFreq >> 8), (unsigned char)(colNextMostFreq) ); + int fg_intensity = fg.Red() + fg.Green() + fg.Blue(); + int bg_intensity = bg.Red() + bg.Green() + bg.Blue(); + + if (bg_intensity > fg_intensity) + { + //swap fg and bg + wxColour tmp = fg; + fg = bg; + bg = tmp; + } + int hotSpotX; int hotSpotY; -- 2.45.2