From 271572942bbb2024a0519a959595b81e6bd3f76e Mon Sep 17 00:00:00 2001 From: John Chen Date: Sat, 27 Jan 2024 20:54:11 -0600 Subject: [PATCH] Fixed the bitmap bug --- engine/src/main/coffee/extensions/bitmap.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/engine/src/main/coffee/extensions/bitmap.coffee b/engine/src/main/coffee/extensions/bitmap.coffee index 84bd1ee48..07ef5095e 100644 --- a/engine/src/main/coffee/extensions/bitmap.coffee +++ b/engine/src/main/coffee/extensions/bitmap.coffee @@ -60,9 +60,9 @@ copyToDrawing = (image, x, y) -> # (World) => (ImageData, String) => Unit copyToShape = (image, name, rotatable = false) -> checkIsImage(image) - if (image.width > 512 and image.height > 512) + if (image.width >= 512 and image.height >= 512) image = scaled(image, 512, 512) - else if (image.width > 256 and image.height > 256) + else if (image.width >= 256 and image.height >= 256) image = scaled(image, 256, 256) else image = scaled(image, 128, 128) workspace.updater.importImage(image, 0, 0, name, rotatable) @@ -195,7 +195,6 @@ setPixel = (data, width, x, y, rgba) -> index = 4 * ((y * width) + x) for i in [0..3] data[index + i] = rgba[i] - data[index + 3] = 255 return # (Array[Int], Int, Int, Int, Array[RGBA]) => Unit