diff --git a/subwave_nowplaying.star b/subwave_nowplaying.star index aa93254..ed9419b 100644 --- a/subwave_nowplaying.star +++ b/subwave_nowplaying.star @@ -611,16 +611,22 @@ def _glitch_scanlines(): lines.append(render.Box(width = ART_SLOT, height = 1, color = "#00000000")) pattern = render.Column(children = lines) + # The ramp's end and the next cycle's snap-back share the exact same + # percentage (a zero-duration jump), rather than the snap landing one + # tick later -- that one-tick gap got linearly interpolated, which + # for a single tick showed the pattern at a fractional, not-quite-0 + # offset instead of cleanly snapping, producing a brief flicker right + # at the loop point. keyframes = [] for cycle in range(SCANLINE_CYCLES): cycle_start = cycle * _SCANLINE_CYCLE_TICKS - ramp_end = cycle_start + _SCANLINE_CYCLE_TICKS - 1 # last tick of the cycle is the snap back to 0 + cycle_end = cycle_start + _SCANLINE_CYCLE_TICKS # == next cycle's cycle_start keyframes.append(animation.Keyframe( percentage = float(cycle_start) / SCANLINE_SWEEP_DURATION, transforms = [animation.Translate(0, 0)], )) keyframes.append(animation.Keyframe( - percentage = float(ramp_end) / SCANLINE_SWEEP_DURATION, + percentage = float(cycle_end) / SCANLINE_SWEEP_DURATION, transforms = [animation.Translate(0, SCANLINE_SPACING)], curve = "linear", ))