Fixed issue where the canvas was stuck on 64x64 size

This commit is contained in:
OverloadedOrama 2019-12-28 19:03:45 +02:00
parent d1e5b23f0b
commit 04fe708560
2 changed files with 5 additions and 1 deletions

View file

@ -88,7 +88,7 @@ func _on_ImportSprites_files_selected(paths : PoolStringArray) -> void:
var cropped_image := Image.new()
cropped_image = image.get_rect(Rect2(frame_width * xx, frame_height * yy, frame_width, frame_height))
canvas.size = cropped_image.get_size()
image.convert(Image.FORMAT_RGBA8)
cropped_image.convert(Image.FORMAT_RGBA8)
cropped_image.lock()
var tex := ImageTexture.new()
tex.create_from_image(cropped_image, 0)