From 750acafbde75f2f9006a1aee9da683b20e20998e Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 16 Aug 2023 15:55:22 +0200 Subject: [PATCH] fixed setting global animation sync frame when started with ".init_event" The previous code only handled adjusting the initial animation sync frame when starting the animation using an "init delay" configuration (starting the animation after a delay), but did not handle starting the animation using an "init event" configuration (like triggering by a click event or by a custom element change), in which case the sync frame should also be reset. --- src/anim.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/anim.c b/src/anim.c index d780658c..d570be06 100644 --- a/src/anim.c +++ b/src/anim.c @@ -1566,7 +1566,12 @@ static int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, part->init_event_state) { if (part->initial_anim_sync_frame > 0) - part->initial_anim_sync_frame -= part->init_delay_counter - 1; + { + if (part->init_delay_counter > 0) + part->initial_anim_sync_frame -= part->init_delay_counter - 1; + else + part->initial_anim_sync_frame = anim_sync_frame; + } part->init_delay_counter = 1; part->init_event_state = FALSE; -- 2.34.1