Fix QR codes rendered wide/horizontal on ILI9341 displays#353
Draft
Copilot wants to merge 1 commit into
Draft
Conversation
Agent-Logs-Url: https://github.com/3rdIteration/seedsigner/sessions/35297c70-8a60-43b5-8caa-5a599a0f1f80 Co-authored-by: 3rdIteration <2230318+3rdIteration@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
3rdIteration
April 27, 2026 13:43
View session
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.
On ILI9341 displays (240×320 physical),
Rendererswaps canvas dimensions tocanvas_width=320, canvas_height=240so the 90° hardware rotation inshow_imageproduces a correct portrait layout.QRDisplayScreenwas blindly passing those non-square dimensions to the QR encoder, which stretched the square QR image to 320×240 — producing the wide/horizontal QR codes seen in B10.Fix: compute
qr_size = min(canvas_width, canvas_height)once before the render loop and use it for both axes.No behavioural change on square (240×240 ST7789) displays.
This pull request is categorized as a:
Checklist
pytestand made sure all unit tests pass before sumbitting the PRIf you modified or added functionality/workflow, did you add new unit tests?
I have tested this PR on the following platforms/os:
Note: Keep your changes limited in scope; if you uncover other issues or improvements along the way, ideally submit those as a separate PR. The more complicated the PR the harder to review, test, and merge.