From 04fe7085602af16570fa678ef36a111a6da46fe3 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sat, 28 Dec 2019 19:03:45 +0200 Subject: [PATCH] Fixed issue where the canvas was stuck on 64x64 size --- Scripts/Canvas.gd | 4 ++++ Scripts/Dialogs/ImportSprites.gd | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Scripts/Canvas.gd b/Scripts/Canvas.gd index d7620aa57..4e04a1667 100644 --- a/Scripts/Canvas.gd +++ b/Scripts/Canvas.gd @@ -110,6 +110,10 @@ func _input(event : InputEvent) -> void: var ld := 0 var ld_amount := 0.1 + west_limit = location.x + east_limit = location.x + size.x + north_limit = location.y + south_limit = location.y + size.y if Global.selected_pixels.size() != 0: west_limit = max(west_limit, Global.selection_rectangle.polygon[0].x) east_limit = min(east_limit, Global.selection_rectangle.polygon[2].x) diff --git a/Scripts/Dialogs/ImportSprites.gd b/Scripts/Dialogs/ImportSprites.gd index de20070bc..012f26e09 100644 --- a/Scripts/Dialogs/ImportSprites.gd +++ b/Scripts/Dialogs/ImportSprites.gd @@ -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)