From: Vadim Zeitlin Date: Thu, 20 Sep 2012 20:00:48 +0000 (+0000) Subject: Fix alpha handling in Scintilla when not using wxGraphicsContext. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4f97cb83cfce5027a8c000afb176e74757524cc7 Fix alpha handling in Scintilla when not using wxGraphicsContext. When using raw bitmap data access classes such as wxAlphaPixelData we must destroy them to ensure that the changes done via them are committed to the bitmap before drawing the bitmap. Just add an extra block (the diff should be viewed ignoring white space to see the only significant change) to ensure that wxAlphaPixelData is destroyed before DrawBitmap() is called. Closes #14680. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72525 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index 9e69d2fcd5..0a774a063c 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -337,55 +337,60 @@ void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, int x, y; wxRect r = wxRectFromPRectangle(rc); wxBitmap bmp(r.width, r.height, 32); - wxAlphaPixelData pixData(bmp); - // Set the fill pixels - ColourDesired cdf(fill.AsLong()); - int red = cdf.GetRed(); - int green = cdf.GetGreen(); - int blue = cdf.GetBlue(); + // This block is needed to ensure that the changes done to the bitmap via + // pixel data object are committed before the bitmap is drawn. + { + wxAlphaPixelData pixData(bmp); + + // Set the fill pixels + ColourDesired cdf(fill.AsLong()); + int red = cdf.GetRed(); + int green = cdf.GetGreen(); + int blue = cdf.GetBlue(); + + wxAlphaPixelData::Iterator p(pixData); + for (y=0; y