Skip to content

fix(send): pack the QR block in the center of the stage - #11

Merged
BlackPool25 merged 1 commit into
mainfrom
fix/center-qr-block
Aug 3, 2026
Merged

BlackPool25 merged 1 commit into
mainfrom
fix/center-qr-block

Conversation

@BlackPool25

Copy link
Copy Markdown
Owner

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 test

  • Manually tested on: Flutter Android / Flutter Linux / both (block centering verified at tall/square/aspect-ratio canvases in widget tests)

Checklist

  • No wire-format/codec change
  • CHANGELOG / docs updated if user-facing
  • If AI-assisted, I reviewed and understood every line

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.
@BlackPool25
BlackPool25 merged commit 9a0fa9f into main Aug 3, 2026
2 checks passed
@BlackPool25
BlackPool25 deleted the fix/center-qr-block branch August 3, 2026 10:10
@BlackPool25 BlackPool25 mentioned this pull request Aug 3, 2026
4 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant