[ 1565385 ] wxImage scaling fix - apply mask when scaling
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
dba6243c56
commit
1fc1e6af05
@ -469,13 +469,7 @@ wxImage wxImage::Scale( int width, int height, int quality ) const
|
||||
unsigned char *source_alpha = 0 ;
|
||||
unsigned char *target_alpha = 0 ;
|
||||
|
||||
if (M_IMGDATA->m_hasMask)
|
||||
{
|
||||
image.SetMaskColour( M_IMGDATA->m_maskRed,
|
||||
M_IMGDATA->m_maskGreen,
|
||||
M_IMGDATA->m_maskBlue );
|
||||
}
|
||||
else
|
||||
if ( !M_IMGDATA->m_hasMask )
|
||||
{
|
||||
source_alpha = M_IMGDATA->m_alpha ;
|
||||
if ( source_alpha )
|
||||
@ -514,6 +508,14 @@ wxImage wxImage::Scale( int width, int height, int quality ) const
|
||||
}
|
||||
}
|
||||
|
||||
// If the original image has a mask, apply the mask to the new image
|
||||
if (M_IMGDATA->m_hasMask)
|
||||
{
|
||||
image.SetMaskColour( M_IMGDATA->m_maskRed,
|
||||
M_IMGDATA->m_maskGreen,
|
||||
M_IMGDATA->m_maskBlue );
|
||||
}
|
||||
|
||||
// In case this is a cursor, make sure the hotspot is scaled accordingly:
|
||||
if ( HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_X) )
|
||||
image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X,
|
||||
|
Loading…
Reference in New Issue
Block a user