fix(rendering): texture-load heal no longer clobbers explicitly narrowed frames#382
Merged
Conversation
…wed frames A Sprite constructed from a still-loading texture schedules a heal that resets the frame to the full texture on hydration. When a Spritesheet (or any caller) explicitly narrowed the frame in the meantime, that reset threw the chosen frame away — every sliced sprite rendered the whole atlas. The schedule-time reset leaves a 0x0 frame, so a non-empty frame now disables the heal.
Exoridus
enabled auto-merge (squash)
July 16, 2026 16:08
Bundle ReportChanges will increase total bundle size by 561 bytes (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: exo-esm-modules-esmAssets Changed:
Files in
view changes for bundle: exo-full-iife-Exo-iifeAssets Changed:
view changes for bundle: exo-iife-min-Exo-iifeAssets Changed:
Files in
view changes for bundle: exo-esm-esmAssets Changed:
Files in
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Root cause
A
Spriteconstructed from a still-loading texture schedules a heal (the deferred-handle fix that keeps a sprite from staying 0×0): once the texture hydrates,_healOnTextureLoadreset the frame to the full texture. It did so unconditionally — clobbering any frame explicitly narrowed in the meantime.Spritesheet.addFramedoes exactly that (construct sprite, thensetTextureFrame(rect)), so every spritesheet sliced from a not-yet-awaited atlas rendered the whole atlas per sprite. Reproduced in ~5 merged examples (e.g.tile-chunks-and-bands,sprite-follows-body).Fix
The schedule-time
resetTextureFrame()on an unhydrated texture leaves a 0×0 frame (Texture._sizestarts 0×0 until load). A non-empty frame at hydration time therefore means someone chose it deliberately — the heal now only fires when the frame is still 0×0. One-condition change; the original heal behavior (bare sprite from deferred texture) is preserved and pinned by test.Verification
pnpm test:core: 307 files / 4943 tests green.tile-chunks-and-bandsexample post-fix shows the explorer as a single character sprite (previously the full ~15-character atlas grid) — zero example edits needed, which was the point of fixing at engine altitude.