Skip to content

Border animations: fix full-screen flash on first attach#140

Open
Krathe82 wants to merge 1 commit into
DanderBot:mainfrom
Krathe82:pr/animated-border-flash
Open

Border animations: fix full-screen flash on first attach#140
Krathe82 wants to merge 1 commit into
DanderBot:mainfrom
Krathe82:pr/animated-border-flash

Conversation

@Krathe82

@Krathe82 Krathe82 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Problem

Border animation glow effects (Pulsate / Chase / Flash / Proc) read their target frame's width/height when they start. On the very first attach the animation rectangle had only just been created, so the layout engine hadn't sized it yet — GetWidth() returns 0 — and the glow rendered huge / detached from the actual border for a single frame. The result is a brief full-screen flash, easily reproduced by enabling a glow border animation in test mode.

Fix

Start the glow only once the target has a real size. If it isn't laid out yet, defer the start to the next frame (after the layout pass) so it always starts against valid geometry.

A per-start token — replaced by a newer Start and cleared by StopAnimation — guarantees a deferred start that was superseded or stopped in the meantime never fires (no double glow, no orphan glow).

The OnUpdate overlay effects (Wipe / Ripple / Segment Reveal / Sides Only / Corners Only) are unaffected: they anchor relative to the rect's corners — which resolve through the anchor chain immediately, independent of the numeric width — and start at alpha 0.

LCG glow effects (Pulsate/Chase/Flash/Proc) read their target frame's
width/height at start. On the very first attach the animRect was only just
created, so the layout engine hadn't sized it yet (GetWidth() == 0) and the
glow rendered huge / detached for one frame — the brief full-screen flash,
reproducible in test mode.

Start the glow only once the target has a real size; if it isn't laid out yet,
defer to the next frame (after the layout pass). A per-start token — replaced by
a newer Start and cleared by StopAnimation — guarantees a deferred start that
was superseded or stopped never fires. The OnUpdate overlay effects are
unaffected: they anchor relative to the rect's corners (which resolve through the
anchor chain immediately) and start at alpha 0.
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.

1 participant