diff --git a/src/widgets/ImageRoll.cpp b/src/widgets/ImageRoll.cpp index acdff5d2f..637bb1b77 100644 --- a/src/widgets/ImageRoll.cpp +++ b/src/widgets/ImageRoll.cpp @@ -297,20 +297,27 @@ bool ImageRoll::Ok() const } void ImageRoll::DrawBitmap(wxDC &dc, wxBitmap &bitmap, - int x, int y, wxRasterOperationMode logicalFunc) + int x, int y, int logicalFunc) { - if (logicalFunc == wxCOPY) + auto func = static_cast< wxRasterOperationMode >( logicalFunc ); + if (func == wxCOPY) dc.DrawBitmap(bitmap, x, y); else { wxMemoryDC memDC; memDC.SelectObject(bitmap); dc.Blit(x, y, bitmap.GetWidth(), bitmap.GetHeight(), - &memDC, 0, 0, logicalFunc); + &memDC, 0, 0, func); } } -void ImageRoll::Draw(wxDC &dc, wxRect rect, wxRasterOperationMode WXUNUSED(logicalFunc)) +void ImageRoll::Draw(wxDC &dc, wxRect rect) { + Draw( dc, rect, wxCOPY ); +} + +void ImageRoll::Draw(wxDC &dc, wxRect rect, int WXUNUSED(logicalFunc)) +{ + auto func = wxCOPY; int width = rect.width; int height = rect.height; int num = (int)mPieces.size(); @@ -335,7 +342,7 @@ void ImageRoll::Draw(wxDC &dc, wxRect rect, wxRasterOperationMode WXUNUSED(logic // fixed if (mPieces[i].Ok()) - DrawBitmap(dc, mPieces[i], rect.x + x, rect.y); + DrawBitmap(dc, mPieces[i], rect.x + x, rect.y, func); x += w; } else { @@ -348,7 +355,7 @@ void ImageRoll::Draw(wxDC &dc, wxRect rect, wxRasterOperationMode WXUNUSED(logic j = 0; while(j < space) { if (mPieces[i].Ok()) - DrawBitmap(dc, mPieces[i], rect.x + x + j, rect.y); + DrawBitmap(dc, mPieces[i], rect.x + x + j, rect.y, func); j += w; } @@ -375,7 +382,7 @@ void ImageRoll::Draw(wxDC &dc, wxRect rect, wxRasterOperationMode WXUNUSED(logic // fixed if (mPieces[i].Ok()) - DrawBitmap(dc, mPieces[i], rect.x, rect.y + y); + DrawBitmap(dc, mPieces[i], rect.x, rect.y + y, func); y += h; } else { @@ -388,7 +395,7 @@ void ImageRoll::Draw(wxDC &dc, wxRect rect, wxRasterOperationMode WXUNUSED(logic j = 0; while(j < space) { if (mPieces[i].Ok()) - DrawBitmap(dc, mPieces[i], rect.x, rect.y + y + j); + DrawBitmap(dc, mPieces[i], rect.x, rect.y + y + j, func); j += h; } @@ -398,7 +405,7 @@ void ImageRoll::Draw(wxDC &dc, wxRect rect, wxRasterOperationMode WXUNUSED(logic } break; // case VerticalRoll case FixedImage: - DrawBitmap(dc, mPieces[0], rect.x, rect.y); + DrawBitmap(dc, mPieces[0], rect.x, rect.y, func); break; /* the other possible cases don't really make sense, but not having them * listed gives a GCC warning */ diff --git a/src/widgets/ImageRoll.h b/src/widgets/ImageRoll.h index 943b9bfda..b04413176 100644 --- a/src/widgets/ImageRoll.h +++ b/src/widgets/ImageRoll.h @@ -13,7 +13,7 @@ #define __AUDACITY_IMAGE_ROLL__ #include -#include // for enum wxRasterOperationMode +// #include // for enum wxRasterOperationMode #include #include "wxPanelWrapper.h" // to inherit @@ -45,7 +45,8 @@ class ImageRoll wxSize GetMaxSize() const { return mMaxSize; } void Draw(wxDC &dc, wxRect rect, - wxRasterOperationMode logicalFunc = wxCOPY); + int /* wxRasterOperationMode */ logicalFunc); + void Draw(wxDC &dc, wxRect rect); // default logicalFunc to wxCOPY static ImageArray SplitH(const wxImage &src, wxColour magicColor); static ImageArray SplitV(const wxImage &src, wxColour magicColor); @@ -53,7 +54,8 @@ class ImageRoll protected: void DrawBitmap(wxDC &dc, wxBitmap &bitmap, - int x, int y, wxRasterOperationMode logicalFunc = wxCOPY); + int x, int y, + int /* wxRasterOperationMode */ logicalFunc); void Init(RollType type, const wxImage &src, wxColour magicColor);