Repository navigation
fix(send): scale QR tiles continuously to fill the stage, keep the chosen layout - #10
Merged
Merged
Conversation
…osen layout The broadcast grid stepped tiles in whole-module jumps (integer px/module), so growing the window wasted space between and around the QRs until the next whole module fit. Tiles now fill their cell edge-to-edge with the QR-spec quiet zone as the only separator, scaled continuously to the viewport (nearest-neighbour rendering keeps module edges hard and camera-decodable — anti-aliasing, not fractional size, was the decode killer). The chosen layout stays fixed: the adaptive layout re-flow is removed, so a 2x2 grid stays 2x2.
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.
What & Why
The broadcast QR grid stepped tile size in whole-module jumps (integer px/module, floored), so a tile only grew when an entire extra module fit — and until then, growing the window just added dead space between and around the QRs. On a portrait phone a 2x2 grid left big empty margins, and the QRs sat small in the center.
This changes the renderer to continuous linear scaling:
min(cellW, cellH), the px/module scale is fractional, so tiles grow proportionally as the window grows and no space is wasted between or around the QRs (only the QR-spec 4-module quiet zone separates tiles).FilterQuality.noneblit, non-AA path fallback), so module edges remain hard at any scale — anti-aliasing, not fractional size, is the decode killer, so QRs stay camera-decodable (the decode-back e2e painter test still passes).setLayout/LayoutBuildermachinery added in feat(send): re-flow the QR grid to fit the viewport #7.docs/ARCHITECTURE.mdpx/module note updated to reflect continuous hard-edge scaling.How it was tested
New painter tests:
single tile fills the canvas edge to edge (no dead margin)andtiles scale linearly with the canvas, not in integer steps(canvas 116 vs 232 → module position doubles). Both fail on the previous renderer (module landed in the dead margin → expected white, got espresso).Existing painter tests updated for the continuous geometry; the real-QR decode-back test and bitmap-vs-path identity test still pass unchanged.
Reverted the feat(send): re-flow the QR grid to fit the viewport #7 re-flow tests (
setLayout,re-flows the live layout).cd flutter_app/rust && cargo build --lib && cd flutter_app && flutter analyze && flutter test— 116 tests pass.flutter analyze+flutter testManually tested on: Flutter Android / Flutter Linux / both (tile fill + linear scaling verified at multiple canvas sizes in widget tests)
Checklist