Skip to content

fix: apply initial keyframe immediately in Animate() to prevent frame overlap#48

Merged
Xerrion merged 2 commits intomasterfrom
copilot/fix-animation-frame-issue
Feb 24, 2026
Merged

fix: apply initial keyframe immediately in Animate() to prevent frame overlap#48
Xerrion merged 2 commits intomasterfrom
copilot/fix-animation-frame-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 24, 2026

When multiple animations are started in quick succession, frames remain visible at their pre-animation anchor positions until the first OnUpdate tick. For entrance animations, this means all frames briefly sit at their final destinations simultaneously instead of being at their off-screen start positions.

Change

  • Apply the first keyframe (progress=0) immediately at the end of Animate() via ApplyToFrame, so entrance animations move frames to their start positions (e.g., off-screen) synchronously rather than waiting for the next render tick.
-- After creating state and registering the animation:
local kf1 = def.keyframes[1]
ApplyToFrame(frame, state,
    GetProperty(kf1, "translateX"),
    GetProperty(kf1, "translateY"),
    GetProperty(kf1, "scale"),
    GetProperty(kf1, "alpha"))

This is a no-op for exit and attention animations since their first keyframe is identity (translateX/Y=0, scale=1, alpha=1). For entrance animations, it immediately positions the frame at its animation start point. Also eliminates the visual snap that previously occurred when delayed entrance animations transitioned from "visible at anchor" to "off-screen start position."

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • luarocks.org
    • Triggering command: /usr/bin/lua5.1 /usr/bin/lua5.1 /usr/bin/luarocks install luacheck (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

When 2 or more animations are started in quick succession. The frames can get stuck on to of each other.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

… overlap

Co-authored-by: Xerrion <1850632+Xerrion@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix animation frames getting stuck on top of each other fix: apply initial keyframe immediately in Animate() to prevent frame overlap Feb 24, 2026
Copilot AI requested a review from Xerrion February 24, 2026 07:28
@Xerrion Xerrion marked this pull request as ready for review February 24, 2026 12:10
@Xerrion Xerrion merged commit b5ea1d2 into master Feb 24, 2026
1 check passed
@Xerrion Xerrion deleted the copilot/fix-animation-frame-issue branch February 24, 2026 12:11
Xerrion pushed a commit that referenced this pull request Feb 24, 2026
🤖 I have created a release *beep* *boop*
---


## [3.5.5](3.5.4...3.5.5)
(2026-02-24)


### Bug Fixes

* apply initial keyframe immediately in Animate() to prevent frame
overlap ([#48](#48))
([b5ea1d2](b5ea1d2))
* harden callback safety, SlideAnchor guards, and easing validation
([#52](#52))
([bf71c6a](bf71c6a))
* prevent anchor drift when animations complete with an onFinished
callback ([#47](#47))
([e4a9d04](e4a9d04))


### Documentation

* add bug report and feature request issue templates
([#53](#53))
([ec638f6](ec638f6))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants