Skip to content

Commit

Permalink
Fix border of dynamic groups with animated position childd auras
Browse files Browse the repository at this point in the history
Before 5.12.0 aniamtions would not run immediately on start leading to
bug reports like WeakAuras#4696, where a fade in animation would briefly show at
full opacity, because it was applied one frame late.

The dynamic group's border uses the current position of auras, whenever
it is triggered via an aura's expand/collapse.

Thus for an aura with a slide in position, before 5.12.0 the normal
position was used, and with 5.12.0 the starting point of the slide
animation.

The interaction between animations and borders is messy. It probably
should have two modes:
* Taking the static position/size
* Taking the dynamic position/sizes but also update on any changes to the
  position/sizes

And this should actually be decided by the child regions, a child should
have a "bounding box", which is what the border, but also layout should
take into account. And a every time the bounding box changes, the
dynamic groups layout/border functions should run. It's then up to the
region whether animations/conditions etc. change the bounding box.

For now, delay the first animation running with C_Timer.After(0), which
ensures that it runs in the initial frame, but after everything else.

Fixes: WeakAuras#4933
  • Loading branch information
InfusOnWoW committed Mar 23, 2024
1 parent e0f390b commit 51981e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion WeakAuras/Animations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,9 @@ function Private.Animate(namespace, uid, type, anim, region, inverse, onFinished
last_update = GetTime()
updatingAnimations = true;
end
RunAnimation(key, animation, 0, GetTime())
C_Timer.After(0, function()
RunAnimation(key, animation, 0, GetTime())
end)
return true;
else
if(animations[key]) then
Expand Down

0 comments on commit 51981e3

Please sign in to comment.