Skip to content

Commit

Permalink
fix: add dur for anims for delayed_prop task
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-liang committed Sep 26, 2023
1 parent c5c670c commit fdd09f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arena/scene.py
Expand Up @@ -396,7 +396,8 @@ def create_delayed_task(self, obj, anim):

async def _delayed_task():
try:
await asyncio.sleep(anim.get('dur', 0) / 1000) # convert ms to s
sleep_dur = (anim.get('dur', 0) + anim.get('delay', 0)) / 1000
await asyncio.sleep(sleep_dur) # this is in seconds
final_state = anim["from"] if anim.get("dir", "normal") == "reverse"\
else anim["to"]
obj.update_attributes(**{anim["property"]: final_state})
Expand Down

0 comments on commit fdd09f1

Please sign in to comment.