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:
@@ -2050,6 +2050,14 @@ namespace lime {
|
||||
|
||||
ImageDataUtil::CopyPixels (image, sourceImage, sourceRect, destPoint, NULL, NULL, mergeAlpha);
|
||||
|
||||
} else {
|
||||
|
||||
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);
|
||||
@@ -2058,6 +2066,8 @@ namespace lime {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void lime_image_data_util_fill_rect (value image, value rect, int rg, int ba) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user