fix(core): prevent gaps in scaled rounded boxes#148
Merged
doodlewind merged 2 commits intoJul 22, 2026
Conversation
odex21
marked this pull request as ready for review
July 22, 2026 12:35
odex21
marked this pull request as draft
July 22, 2026 12:36
odex21
marked this pull request as ready for review
July 22, 2026 12:53
doodlewind
approved these changes
Jul 22, 2026
doodlewind
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed and verified locally after resolving the #149 restructure conflict (merged main; the fix now lives at engine/core/src/draw.rs).
- Root cause confirmed: xy_word/wh_word round each piece's position and extent independently, so fractional transformed edges let adjacent fast-path pieces disagree by 1px. Quantizing the four outer edges once and deriving all seven pieces from them is the right fix, and the added rf clamp correctly guards the degenerate case where quantization shrinks the box below 2r.
- Verified the regression test fails against the unfixed draw.rs and passes with the fix.
- cargo test (engine/core): 82/82. Full bun run test suite: pass. tape:check: 180/180 hero frames unchanged — integer-coordinate output is byte-identical, as intended.
doodlewind
added a commit
that referenced
this pull request
Jul 23, 2026
- bump package.json, tools/cli/package.json, pocket.json to 0.7.0 - changelog: 0.7.0 entry (Pocket Vapor GBA/GB/NES + ESP32, boards as data + execution classes, Cover Flow launcher, .pocket v1, widget family, Vita GXM, Vue SFC + 3.6.0-rc.1, contracts semantics as fields) - fix tools/pocket-pack.ts section-kind inference (release tsc gate; regressed unobserved when #139 added the cover section after v0.6.0) - re-bake 7 web goldens stale since #148's scaled rounded-box gap fix (gallery x5, music.60, motions.236) — 49/49 green Co-authored-by: Claude Fable 5 <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
scaleX/scaleY0.96 rounded boxRoot cause
The flat rounded-box fast path emitted four textured corners and three rectangles from fractional transformed coordinates. DrawList stores integer positions and integer sizes, so independently rounding each piece's start and extent could leave adjacent pieces one pixel apart. A pressed button using
scale: 0.96exposed the gaps as a black cross through its background.The fix quantizes the outer boundaries once and derives every piece from those same boundaries. The fast path still emits the same seven draw operations and performs no additional allocation.
Visual comparison
Validation
cargo test --manifest-path core/Cargo.toml scaled_flat_rounded_box_has_no_gaps_between_fast_path_pieces -- --nocapturecargo test --manifest-path core/Cargo.toml(82 passed)