Skip to content

Commit

Permalink
Fixed the bitmap bug
Browse files Browse the repository at this point in the history
  • Loading branch information
John Chen committed Jan 28, 2024
1 parent f43a94b commit 2715729
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions engine/src/main/coffee/extensions/bitmap.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2715729

Please sign in to comment.