1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-30 23:19:49 +00:00

Fix playback position

This commit is contained in:
Emmanouil Papadeas 2024-12-08 02:58:02 +02:00
parent 1b7494a767
commit 2c8c1ba8fd

View file

@ -65,7 +65,12 @@ func _ready() -> void:
func _on_cel_switched() -> void:
z_index = 1 if button_pressed else 0
if is_instance_valid(audio_player):
audio_player.play(Global.current_project.current_frame / Global.current_project.fps)
var audio_length := audio_player.stream.get_length()
var normalized_pos := Global.current_project.current_frame / Global.current_project.fps
if normalized_pos < 1:
audio_player.play(normalized_pos * audio_length)
else:
audio_player.stop()
func update_buttons() -> void: