]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/cursor.cpp
samples.inc is not data file
[wxWidgets.git] / src / gtk / cursor.cpp
index fe6c31ea390535506ea750e0ba46cbe1086d5993..54bd0e23a3f612432b3faeaf75dfb88531ab6c0b 100644 (file)
@@ -7,11 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "cursor.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/cursor.h"
 #include "wx/utils.h"
 #include "wx/app.h"
@@ -252,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;