PR_26179_CHARLIE_027-sprites-preview-export#263
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 51b0225232
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| function exportPreviewPng() { | ||
| const canvas = document.querySelector("[data-sprites-preview-canvas]"); |
There was a problem hiding this comment.
Export the sprite at the selected grid size
When the user downloads after choosing either 16x16 or 32x32, this exports the fixed preview canvas, which is declared as width="160" height="160" in toolbox/sprites/index.html, so every PNG is 160×160 instead of matching the advertised draft grid dimensions. That makes the downloaded sprite asset inconsistent with the selected canvas size; render the export from an offscreen canvas sized to editorState.gridSize and keep the 160px canvas only for display.
Useful? React with 👍 / 👎.
| box-shadow: 0 1px 4px var(--swatch-shadow-color) | ||
| } | ||
|
|
||
| .sprite-preview-shell { |
There was a problem hiding this comment.
Wire the preview styles into the loaded stylesheet
These new .sprite-preview-* rules are added to gamefoundrystudio.css, but the sprites page only links assets/theme-v2/css/theme.css, and that entrypoint does not import gamefoundrystudio.css. In the actual /toolbox/sprites/index.html page the preview/export panel therefore loses the intended shell, border, sizing, and pixelated rendering; move these rules into an imported Theme V2 module or wire this stylesheet intentionally.
Useful? React with 👍 / 👎.
Summary
toBlob; no save-to-library, publishing, API/DB/schema changes, browser storage, or stale PR PR_26177_CHARLIE_009-sprites-legacy-audit-plan #219-PR_26177_CHARLIE_018-sprites-testable-mvp-completion #228 code.Validation
node --check assets/toolbox/sprites/js/index.jsPASSnode --check dev/tests/playwright/tools/SpritesToolShell.spec.mjsPASSgit diff --check ...PASSnpx playwright test dev/tests/playwright/tools/SpritesToolShell.spec.mjs --workers=1 --reporter=list --output=<temp>PASS, 1 test passedArtifact
dev/workspace/zip/PR_26179_CHARLIE_027-sprites-preview-export_delta.zip