mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 09:09:47 +00:00
For PixelCel's set_content
not working when passing an Image instead of ImageExtended
This commit is contained in:
parent
1d9b9fda1e
commit
93eab6929b
|
@ -25,7 +25,13 @@ func get_content() -> ImageExtended:
|
||||||
|
|
||||||
|
|
||||||
func set_content(content, texture: ImageTexture = null) -> void:
|
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()):
|
if is_instance_valid(texture) and is_instance_valid(texture.get_image()):
|
||||||
image_texture = texture
|
image_texture = texture
|
||||||
if image_texture.get_image().get_size() != image.get_size():
|
if image_texture.get_image().get_size() != image.get_size():
|
||||||
|
|
Loading…
Reference in a new issue