1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 09:09:47 +00:00

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.
This commit is contained in:
Emmanouil Papadeas 2024-01-25 01:06:30 +02:00
parent de5db85345
commit 964e9fbd26

View file

@ -364,7 +364,10 @@ func _resize_rect(pos: Vector2, dir: Vector2) -> void:
func resize_selection() -> void: func resize_selection() -> void:
var size := big_bounding_rectangle.size.abs() 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: if is_moving_content:
preview_image.copy_from(original_preview_image) preview_image.copy_from(original_preview_image)
preview_image.resize(size.x, size.y, Image.INTERPOLATE_NEAREST) preview_image.resize(size.x, size.y, Image.INTERPOLATE_NEAREST)