Repository navigation
fix(send): pack the QR block in the center of the stage - #11
Merged
Merged
Conversation
Per-cell centering spread the tiles apart on tall screens: each QR was centered inside its own cell, so a 2x2 on a portrait canvas left a dead band between the two rows and pushed the QRs toward the top and bottom. The tiles are now packed into one flush block (cols x rows of edge-to-edge tiles, only the QR-spec quiet zone separating them) and the whole block is centered in the canvas, keeping every QR close enough to hold the phone up to the middle of the screen.
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 sender grid centered each QR inside its own cell, so on a tall (portrait) screen a 2×2 layout spread the two rows far apart — each tile was vertically centered in its tall cell, leaving a big dead band between the rows and pushing the QRs toward the top and bottom edges. That made it impossible to hold the phone close to a central QR.
Tiles are now packed into one flush block (cols×rows of edge-to-edge tiles, only the QR-spec 4-module quiet zone separating them) and the whole block is centered in the canvas. A 2×2 on a portrait phone sits tight in the middle of the screen — every QR is adjacent and reachable by holding the phone to the center.
Continuous linear scaling and nearest-neighbour hard-edge rendering (from the previous PR) are unchanged.
How it was tested
New regression:
2×2 block concentrates in the center of a tall canvas— rasterizes grid4 at 160×320, asserts both rows are painted, the row gap equals the tile side (80px, not the 160px spread of per-cell centering), and both rows sit inside the central block band. Fails on the previous painter (module lands in the dead band → expected white, got espresso).Updated the painter-test geometry helper to block math.
cd flutter_app/rust && cargo build --lib && cd flutter_app && flutter analyze && flutter test— 117 tests pass.flutter analyze+flutter testManually tested on: Flutter Android / Flutter Linux / both (block centering verified at tall/square/aspect-ratio canvases in widget tests)
Checklist