Skip to content

fix(transition): crossfade backgrounds in float and complete the pan - #131

Merged
LeadcodeDev merged 1 commit into
mainfrom
fix/transition-float-crossfade
Aug 2, 2026
Merged

fix(transition): crossfade backgrounds in float and complete the pan#131
LeadcodeDev merged 1 commit into
mainfrom
fix/transition-float-crossfade

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

Closes #124. Part of the chantier #123.

Independent of the other six workstreams: disjoint file set, compiles and tests green on its own against main. Mergeable in any order.

Full rationale, measurements and evidence are in the commit message and in #124.

Three defects in the camera pan, all measured.

The background stepped by a full level across the whole frame at every
junction. `set_alpha_f` quantises to an 8-bit alpha; while that byte is below
255 the premultiplied blend truncates ~1 LSB per channel everywhere, and the
instant it reaches 255 Skia takes the exact opaque path and every pixel gains
the level back in a single frame. The step measured exactly 1.0 in all six
transitions of the dark-premium template, and a prediction that it moves to
wherever the alpha byte first saturates held on four different easings.
Crossfading in f32 removes it: 1.01 to 0.01 at the same frame, now matching the
surrounding curve.

`background: static` held the outgoing scene's background for the entire pan
and then cut to the incoming one — 37.9 luminance units in a single frame on a
synthetic pair. It now crossfades, which is a no-op when the two backgrounds
match and softens the cut when they do not, rather than erroring on a case
authors can legitimately write.

Transitions never rendered their completed state: frames ran 0..N-1 against a
divisor of duration*fps, so progress peaked at 0.978 and the residual was
discharged in the first normal frame. Measured as a 22px foreground snap with
linear easing; now 0px.

Pixel baselines shift for every camera_pan, and slightly for other transitions
near their last frame — both intended.

Closes #124
@LeadcodeDev
LeadcodeDev merged commit d296480 into main Aug 2, 2026
3 checks passed
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.

fix(transition): float crossfade, static hard cut, and incomplete final frame

1 participant