1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

fix canvas preview only showing first layer (#844)

This commit is contained in:
Variable 2023-04-12 15:24:19 +05:00 committed by GitHub
parent 2bca2db27a
commit d40b9744ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,6 +42,7 @@ func _draw() -> void:
and current_project.layers[i].is_visible_in_hierarchy()
):
texture_to_draw = current_cels[i].image_texture
draw_texture(texture_to_draw, Vector2.ZERO, modulate_color)
Mode.SPRITESHEET:
var target_frame = current_project.frames[current_project.current_frame]
var frame_image = Image.new()
@ -60,12 +61,12 @@ func _draw() -> void:
if frame >= end_sprite_sheet_frame:
frame = start_sprite_sheet_frame - 1
texture_to_draw = sprite_frames[frame]
draw_texture(texture_to_draw, Vector2.ZERO, modulate_color)
if not texture_to_draw:
return
var rect := Rect2(Vector2.ZERO, texture_to_draw.get_data().get_size())
get_parent().get_node("TransparentChecker").fit_rect(rect)
draw_texture(texture_to_draw, Vector2.ZERO, modulate_color)
func _on_AnimationTimer_timeout() -> void: