mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-19 01:29:49 +00:00
Fix crash when there is no pixel layer in the timeline, only a group layer
This commit is contained in:
parent
acb32844a1
commit
acf376865f
|
@ -16,7 +16,7 @@ onready var animation_timer: Timer = $AnimationTimer
|
|||
|
||||
func _draw() -> void:
|
||||
var current_project: Project = Global.current_project
|
||||
var texture_to_draw := ImageTexture.new()
|
||||
var texture_to_draw: Texture
|
||||
var modulate_color := Color.white
|
||||
match mode:
|
||||
Mode.TIMELINE:
|
||||
|
@ -61,7 +61,9 @@ func _draw() -> void:
|
|||
frame = start_sprite_sheet_frame - 1
|
||||
texture_to_draw = sprite_frames[frame]
|
||||
|
||||
var rect = Rect2(Vector2.ZERO, texture_to_draw.get_data().get_size())
|
||||
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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue