Extend scanline sweep to cover the full glitch window

SCANLINE_SWEEP_DURATION was still a flat 160 ticks (8s) from when
GLITCH_ACTIVE_SECONDS only covered a short burst -- fine at the time,
since nothing animated past that burst anyway. Once GLITCH_ACTIVE_SECONDS
was extended to cover the full show_static window, this fell behind:
animation.Transformation holds at its last keyframe once its own
declared duration elapses, so the scanline sweep visibly froze partway
through while jitter/bands (sized against the full window) kept
animating -- reported as "scanlines stop, but everything else is
running."

SCANLINE_SWEEP_DURATION is now derived from GLITCH_ACTIVE_SECONDS, same
as jitter already is. _SCANLINE_CYCLE_TICKS (sweep speed) is kept fixed
and SCANLINE_CYCLES derived from it, rather than the reverse, so the
sweep doesn't also slow down as the window gets longer.

Verified 1 negligible black-corner hit across 250 frames (consistent
with the known benign corner-tick color blend, not a structural issue),
327KB worst-case payload (strong zoom + random position), well under
the 460KB limit.
This commit is contained in:
poprhythm committed 2026-10-09 18:54:40 -04:00
1 parent 40a740f7e4
commit 7156fa71ae
1 file changed
+15 -3
+15 -3
View File
@@ -596,9 +596,21 @@ def _glitch_jitter(zoom):
# small periodic shifts are the only mechanism that actually works here.
SCANLINE_COUNT = 4
SCANLINE_SPACING = ART_SLOT // SCANLINE_COUNT
SCANLINE_SWEEP_DURATION = 160 # 8s total at the default 50ms/tick
SCANLINE_CYCLES = 8 # how many times the sawtooth below repeats over that
_SCANLINE_CYCLE_TICKS = SCANLINE_SWEEP_DURATION // SCANLINE_CYCLES
# Sized against the full show_static window (GLITCH_ACTIVE_SECONDS), not
# a fixed 8s -- it used to be a flat 160 ticks while GLITCH_ACTIVE_SECONDS
# only covered a short burst, which was fine since nothing animated past
# that burst anyway. Once GLITCH_ACTIVE_SECONDS was extended to cover the
# full window, this fell behind: animation.Transformation holds at its
# last keyframe once its own declared duration is up, so the scanline
# sweep visibly froze (while jitter/bands, sized against the full window,
# kept animating) for however much of the window was left after 8s.
# _SCANLINE_CYCLE_TICKS is kept fixed (same sweep speed as before) and
# SCANLINE_CYCLES derived from it, rather than the other way around, so
# extending the window doesn't also slow the sweep down.
_SCANLINE_CYCLE_TICKS = 20 # 1s per sawtooth cycle at the default 50ms/tick
SCANLINE_SWEEP_DURATION = GLITCH_ACTIVE_SECONDS * _GLITCH_TICKS_PER_SECOND
SCANLINE_CYCLES = SCANLINE_SWEEP_DURATION // _SCANLINE_CYCLE_TICKS
def _glitch_scanlines():
# Modeled on SUB/WAVE's own scanlines, which sweep continuously via
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.