Fix getting a sub-bitmap of wxBitmap with alpha channel and mask
Since wxBitmap can have both alpha channel values and mask we have to use alpha channel (if required) in the sub-bitmap even if the mask is provided too. See #18513.
This commit is contained in:
parent
93f1384f7e
commit
b21f9ff6f5
1 changed files with 2 additions and 2 deletions
|
|
@ -936,6 +936,8 @@ wxBitmap wxBitmap::GetSubBitmap(const wxRect &rect) const
|
|||
double scale = GetScaleFactor();
|
||||
ret.CreateScaled( rect.width, rect.height, GetDepth(), scale );
|
||||
wxASSERT_MSG( ret.IsOk(), wxT("GetSubBitmap error") );
|
||||
if ( HasAlpha() )
|
||||
ret.UseAlpha() ;
|
||||
|
||||
int destwidth = rect.width*scale ;
|
||||
int destheight = rect.height*scale ;
|
||||
|
|
@ -989,8 +991,6 @@ wxBitmap wxBitmap::GetSubBitmap(const wxRect &rect) const
|
|||
mask->OSXCreate( maskbuf , destwidth , destheight , rowBytes );
|
||||
ret.SetMask(mask) ;
|
||||
}
|
||||
else if ( HasAlpha() )
|
||||
ret.UseAlpha() ;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue