From 0d5e9ce48aa9f56dd22236d3ea6a8f54a24d8e92 Mon Sep 17 00:00:00 2001 From: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Wed, 21 Jul 2021 01:24:39 +0300 Subject: [PATCH] Fix crop image crashes on Windows and maybe also fixed buggy behavior? Cropping images seem to be working fine now, or at least I haven't encountered any bugs so far --- src/Autoload/DrawingAlgos.gd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Autoload/DrawingAlgos.gd b/src/Autoload/DrawingAlgos.gd index 262ccecb1..613036e28 100644 --- a/src/Autoload/DrawingAlgos.gd +++ b/src/Autoload/DrawingAlgos.gd @@ -258,12 +258,12 @@ func centralize() -> void: func crop_image() -> void: Global.canvas.selection.transform_content_confirm() - # Use first cel as a starting rectangle - var used_rect : Rect2 = Global.current_project.frames[0].cels[0].image.get_used_rect() - + var used_rect := Rect2() for f in Global.current_project.frames: for cel in f.cels: + cel.image.unlock() var cel_used_rect : Rect2 = cel.image.get_used_rect() + cel.image.lock() if cel_used_rect == Rect2(0, 0, 0, 0): # If the cel has no content continue