From 964e9fbd26f6c209519f86e7322f14354e11432f Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas Date: Thu, 25 Jan 2024 01:06:30 +0200 Subject: [PATCH] Don't set the selection_map of the project to the original_bitmap, if the latter is empty Shouldn't happen, but best to check in case it does. Setting empty data to the selection_map breaks selections. --- src/UI/Canvas/Selection.gd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/UI/Canvas/Selection.gd b/src/UI/Canvas/Selection.gd index 19a7f638d..577dffe97 100644 --- a/src/UI/Canvas/Selection.gd +++ b/src/UI/Canvas/Selection.gd @@ -364,7 +364,10 @@ func _resize_rect(pos: Vector2, dir: Vector2) -> void: func resize_selection() -> void: var size := big_bounding_rectangle.size.abs() - Global.current_project.selection_map.copy_from(original_bitmap) + if original_bitmap.is_empty(): + print("original_bitmap is empty, this shouldn't happen.") + else: + Global.current_project.selection_map.copy_from(original_bitmap) if is_moving_content: preview_image.copy_from(original_preview_image) preview_image.resize(size.x, size.y, Image.INTERPOLATE_NEAREST)