Fix ImageDataUtil.copyPixels crash on Hashlink (#1875)
* Fix copyPixels crash on Hashlink * Move nullcheck to C++ * Simplify further * Avoid unneccessary object allocation * Formatting * Simplify by using an if statement
This commit is contained in:
@@ -2052,7 +2052,17 @@ namespace lime {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
ImageDataUtil::CopyPixels (image, sourceImage, sourceRect, destPoint, alphaImage, alphaPoint, mergeAlpha);
|
if (!alphaPoint) {
|
||||||
|
|
||||||
|
Vector2 _alphaPoint = Vector2 (0, 0);
|
||||||
|
|
||||||
|
ImageDataUtil::CopyPixels (image, sourceImage, sourceRect, destPoint, alphaImage, &_alphaPoint, mergeAlpha);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
ImageDataUtil::CopyPixels (image, sourceImage, sourceRect, destPoint, alphaImage, alphaPoint, mergeAlpha);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user