Fix: PNG download bakes only first frame of animated layers - #175
Merged
Conversation
Creator `download()` used the 5-arg form of `drawImage`, which stretched the whole image (including extra frame columns for blink/sequence parts) into the canvas — animated eyes showed open + closed side-by-side. Switched to the 9-arg form with a source rect of `(0, 0, NATIVE, NATIVE)` so only the first 32×32 frame of each layer is sampled. Mirrors what `drawOnCanvas` already does for live preview. Works for every layer (eyes/heads/body/top) and every kind (static/blink/sequence). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
download()used 5-argdrawImage(img, 0, 0, size, size)— stretched the entire sprite sheet (open+closed eyes etc.) into the output, so animated faces showed multiple frames side-by-side.drawImage(img, 0, 0, NATIVE, NATIVE, 0, 0, size, size)so only frame 0 of each layer is sampled.drawOnCanvas(creator.tsx:86).Test plan
glasses,terminal-round,cheeky-terminal) at 240 / 480 / 960 / 1920 — face shows a single pair of eyes.🤖 Generated with Claude Code