Fix bug with clearing shared alpha channel in wxImage::ClearAlpha().

Allocate our own exclusive copy of the data before modifying it, otherwise
calling ClearAlpha() would clear alpha not only for the image it was called on
but also for all the other images sharing data with it.
This commit is contained in:
Vadim Zeitlin
2015-04-01 14:38:14 +02:00
parent 62f8950e0e
commit 9a9ea0c295
2 changed files with 3 additions and 0 deletions

View File

@@ -591,6 +591,7 @@ All (GUI):
- Fix updating nested window scrollbars in some cases (sbrowne).
- Fix wxPGChoices copy ctor (Snoits).
- Fix wxPixelData<wxImage>::Offset() for alpha (Markus Rollmann).
- Fix bug in wxImage::ClearAlpha() for shared data (Markus Rollmann).
wxGTK:

View File

@@ -2040,6 +2040,8 @@ void wxImage::ClearAlpha()
{
wxCHECK_RET( HasAlpha(), wxT("image already doesn't have an alpha channel") );
AllocExclusive();
if ( !M_IMGDATA->m_staticAlpha )
free( M_IMGDATA->m_alpha );