From 93eab6929bace43b8f65dce9f0e6f76e59b00167 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 15 Dec 2024 21:05:10 +0200 Subject: [PATCH] For PixelCel's `set_content` not working when passing an Image instead of ImageExtended --- src/Classes/Cels/PixelCel.gd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Classes/Cels/PixelCel.gd b/src/Classes/Cels/PixelCel.gd index 82c09bf61..a5d93a773 100644 --- a/src/Classes/Cels/PixelCel.gd +++ b/src/Classes/Cels/PixelCel.gd @@ -25,7 +25,13 @@ func get_content() -> ImageExtended: func set_content(content, texture: ImageTexture = null) -> void: - image = content + var proper_content: ImageExtended + if content is not ImageExtended: + proper_content = ImageExtended.new() + proper_content.copy_from_custom(content, image.is_indexed) + else: + proper_content = content + image = proper_content if is_instance_valid(texture) and is_instance_valid(texture.get_image()): image_texture = texture if image_texture.get_image().get_size() != image.get_size():