image.copyPixels fixes

This commit is contained in:
Joshua Granick
2019-07-26 15:39:52 -07:00
parent 44e111528c
commit c8120c20d5
3 changed files with 8 additions and 2 deletions

View File

@@ -131,7 +131,7 @@ namespace lime {
int destBytesPerPixel = image->buffer->bitsPerPixel / 8;
bool useAlphaImage = (alphaImage && alphaImage->buffer->transparent);
bool blend = (mergeAlpha || (useAlphaImage && !image->buffer->transparent));
bool blend = (mergeAlpha || (useAlphaImage && !image->buffer->transparent) || (!mergeAlpha && !image->buffer->transparent && sourceImage->buffer->transparent));
if (!useAlphaImage) {

View File

@@ -337,7 +337,7 @@ class ImageDataUtil
var destBytesPerPixel = Std.int(image.buffer.bitsPerPixel / 8);
var useAlphaImage = (alphaImage != null && alphaImage.transparent);
var blend = (mergeAlpha || (useAlphaImage && !image.transparent));
var blend = (mergeAlpha || (useAlphaImage && !image.transparent)) || (!mergeAlpha && !image.transparent && sourceImage.transparent);
if (!useAlphaImage)
{

View File

@@ -448,6 +448,12 @@ class Image
sourceImage = clone();
}
if (alphaImage == sourceImage && (alphaPoint == null || (alphaPoint.x == 0 && alphaPoint.y == 0)))
{
alphaImage = null;
alphaPoint = null;
}
switch (type)
{
case CANVAS: