X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/85f6b408dfd796805b1c43718e69549506353ca7..bd1a4a99fc1bec4ac5d0b14379dc5345d6ce3253:/src/common/rgncmn.cpp diff --git a/src/common/rgncmn.cpp b/src/common/rgncmn.cpp index 2b1b5b6600..b06227cc24 100644 --- a/src/common/rgncmn.cpp +++ b/src/common/rgncmn.cpp @@ -9,11 +9,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "rgncmn.h" -#endif - - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -60,9 +55,9 @@ static bool DoRegionUnion(wxRegion& region, { unsigned char hiR, hiG, hiB; - hiR = wxMin(0xFF, loR + tolerance); - hiG = wxMin(0xFF, loG + tolerance); - hiB = wxMin(0xFF, loB + tolerance); + hiR = (unsigned char)wxMin(0xFF, loR + tolerance); + hiG = (unsigned char)wxMin(0xFF, loG + tolerance); + hiB = (unsigned char)wxMin(0xFF, loB + tolerance); // Loop through the image row by row, pixel by pixel, building up // rectangles to add to the region. @@ -101,10 +96,11 @@ static bool DoRegionUnion(wxRegion& region, return true; } - + bool wxRegion::Union(const wxBitmap& bmp) { +#if (!defined(__WXMSW__) || wxUSE_WXDIB) if (bmp.GetMask()) { wxImage image = bmp.ConvertToImage(); @@ -116,6 +112,7 @@ bool wxRegion::Union(const wxBitmap& bmp) 0); } else +#endif { return Union(0, 0, bmp.GetWidth(), bmp.GetHeight()); } @@ -125,12 +122,16 @@ bool wxRegion::Union(const wxBitmap& bmp, const wxColour& transColour, int tolerance) { +#if (!defined(__WXMSW__) || wxUSE_WXDIB) wxImage image = bmp.ConvertToImage(); return DoRegionUnion(*this, image, transColour.Red(), transColour.Green(), transColour.Blue(), tolerance); +#else + return false; +#endif } #else