Skip to content

text: avoid spurious font atlas growth - #1063

Merged
not-fl3 merged 1 commit into
not-fl3:masterfrom
atirna:fix/atlas-row-boundary-doubling
Aug 18, 2026
Merged

text: avoid spurious font atlas growth#1063
not-fl3 merged 1 commit into
not-fl3:masterfrom
atirna:fix/atlas-row-boundary-doubling

Conversation

@atirna

@atirna atirna commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Atlas::cache_sprite places a sprite at cursor_x + GAP, but its row-fit check did not reserve that margin. A sprite that crossed the right edge by one pixel was therefore placed out of bounds and grew the atlas instead of starting a new row.

This checks the placement bound in u32, keeps exact right-edge placement valid, and repacks cached sprites in a deterministic order when the atlas grows.

Fixes #1054

Verification

  • cargo test --lib
  • cargo build --all-targets
  • cargo check --lib --target wasm32-unknown-unknown

@not-fl3

not-fl3 commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Thanks for PR!

@not-fl3
not-fl3 merged commit 8d602d3 into not-fl3:master Aug 18, 2026
6 checks passed
@atirna
atirna deleted the fix/atlas-row-boundary-doubling branch August 18, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants