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

Fixed crash when creating a new project

Caused by #357
This commit is contained in:
Manolis Papadeas 2020-10-23 17:44:37 +03:00
parent 36d88efbd3
commit b3aa4a6343
3 changed files with 2 additions and 2 deletions

View file

@ -39,6 +39,7 @@ func _init(_frames := [], _name := tr("untitled"), _size := Vector2(64, 64)) ->
frames = _frames frames = _frames
name = _name name = _name
size = _size size = _size
frame_duration.append(1)
select_all_pixels() select_all_pixels()
undo_redo = UndoRedo.new() undo_redo = UndoRedo.new()

View file

@ -9,7 +9,7 @@ func _draw() -> void:
if frame >= current_project.frames.size(): if frame >= current_project.frames.size():
frame = current_project.current_frame frame = current_project.current_frame
$AnimationTimer.wait_time = Global.current_project.frame_duration[frame] * (1 / Global.animation_timeline.fps) $AnimationTimer.wait_time = current_project.frame_duration[frame] * (1 / Global.animation_timeline.fps)
if animation_timer.is_stopped(): if animation_timer.is_stopped():
frame = current_project.current_frame frame = current_project.current_frame

View file

@ -15,7 +15,6 @@ func _ready() -> void:
tag_scroll_container = Global.find_node_by_name(self, "TagScroll") tag_scroll_container = Global.find_node_by_name(self, "TagScroll")
timeline_scroll.get_h_scrollbar().connect("value_changed", self, "_h_scroll_changed") timeline_scroll.get_h_scrollbar().connect("value_changed", self, "_h_scroll_changed")
Global.animation_timer.wait_time = 1 / fps Global.animation_timer.wait_time = 1 / fps
Global.current_project.frame_duration.append(1)
func _h_scroll_changed(value : float) -> void: func _h_scroll_changed(value : float) -> void: