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.
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;