Skip to content

Commit

Permalink
[Animation] Adjust action processing
Browse files Browse the repository at this point in the history
This commit slightly changes how actions are processed
by the animator to avoid an issue with progress events reporting
a wrong value after restarting a running animation.
  • Loading branch information
hyazinthh committed Feb 10, 2025
1 parent 7ebefa5 commit d1bfc7d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
- Fixed multisampled raw download
- [Animation] Improved adaptive sampling scheme for splines to avoid infinite recursion when control points are coinciding
- [Animation] Fixed issue with ticks not being processed when all animations are paused
- [Animation] Adjust action processing to resolve an issue with events when restarting an animation

### 5.5.2
- updated Adaptify.Core to 1.3.0 (using local, new style adaptify)
Expand Down
8 changes: 6 additions & 2 deletions src/Aardvark.UI.Primitives/Animation/Animator/AnimatorApp.fs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,15 @@ module Animator =
let animator = { Optic.get lens model with CurrentTick = ValueSome time }
let mutable model = model |> Optic.set lens animator

// Update all running animations
// Process pending actions
for (_, s) in animator.Slots do
model <- s.Commit(model, time)

// Update all running animations by generating and enqueuing Update actions
for (_, s) in animator.Slots do
s.Update time

// Notify all observers
// Process Update actions
for (_, s) in animator.Slots do
model <- s.Commit(model, time)

Expand Down
1 change: 0 additions & 1 deletion src/Aardvark.UI.Primitives/Animation/State/StateMachine.fs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ module private StateMachine =
machine.State <- State.Running (tick - startFrom)
machine.Position <- startFrom
queue.Enqueue { Type = EventType.Start; Value = machine.Value }
queue.Enqueue { Type = EventType.Progress; Value = machine.Value }

| Action.Pause ->
match machine.State with
Expand Down

0 comments on commit d1bfc7d

Please sign in to comment.