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:
@@ -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:
|
||||
|
||||
|
@@ -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 );
|
||||
|
||||
|
Reference in New Issue
Block a user