diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index a7ce14cfb5..59e18badc1 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -252,6 +252,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 a7ce14cfb5..59e18badc1 100644 --- a/src/gtk1/cursor.cpp +++ b/src/gtk1/cursor.cpp @@ -252,6 +252,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;