No changes, just simplify the mask checks in wxImage::Paste().
Replace the test of the form "(!a && b) || (a && b)" with a simple test for "b" and then also replace the test for "b || (c && !b)" with just "b || c". The end result is much easier to read and understand. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67614 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
be0d0fedf9
commit
de83bbe34f
@ -1428,12 +1428,15 @@ void wxImage::Paste( const wxImage &image, int x, int y )
|
||||
if (width < 1) return;
|
||||
if (height < 1) return;
|
||||
|
||||
if ((!HasMask() && !image.HasMask()) ||
|
||||
(HasMask() && !image.HasMask()) ||
|
||||
((HasMask() && image.HasMask() &&
|
||||
// If we can, copy the data using memcpy() as this is the fastest way. But
|
||||
// for this the image being pasted must have "compatible" mask with this
|
||||
// one meaning that either it must not have one at all or it must use the
|
||||
// same masked colour.
|
||||
if ( !image.HasMask() ||
|
||||
((HasMask() &&
|
||||
(GetMaskRed()==image.GetMaskRed()) &&
|
||||
(GetMaskGreen()==image.GetMaskGreen()) &&
|
||||
(GetMaskBlue()==image.GetMaskBlue()))))
|
||||
(GetMaskBlue()==image.GetMaskBlue()))) )
|
||||
{
|
||||
const unsigned char* source_data = image.GetData() + 3*(xx + yy*image.GetWidth());
|
||||
int source_step = image.GetWidth()*3;
|
||||
|
Loading…
Reference in New Issue
Block a user