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:
parent
ffd2857571
commit
d89d730900
@ -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 );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user