]> git.saurik.com Git - wxWidgets.git/commitdiff
unfortunately the fuzzy colour comparison is really needed (why?)
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 7 Jan 2002 00:38:05 +0000 (00:38 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 7 Jan 2002 00:38:05 +0000 (00:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13426 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/tbar95.cpp

index 749aa2bd520f9a6ce8242337f011f73d5e76cc48..aab98f4c5077be1376cebb763cd6919cca0734a7 100644 (file)
@@ -1203,7 +1203,10 @@ WXHBITMAP wxToolBar::MapBitmap(WXHBITMAP bitmap, int width, int height)
 
             for ( size_t k = 0; k < WXSIZEOF(ColorMap); k++ )
             {
-                if ( pixel == ColorMap[k].from )
+                COLORREF col = ColorMap[k].from;
+                if ( abs(GetRValue(pixel) - GetRValue(col)) < 10 &&
+                     abs(GetGValue(pixel) - GetGValue(col)) < 10 &&
+                     abs(GetBValue(pixel) - GetBValue(col)) < 10 )
                 {
                     ::SetPixel(hdcMem, i, j, ColorMap[k].to);
                     break;