Skip to content

blit: accept MicroPython's tuple source in the bounding box - #34

Merged
bdbarnett merged 1 commit into
mainfrom
fix/blit-tuple-source
Sep 26, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
fix/blit-tuple-source

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

FrameBuffer.blit((buf, w, h, fmt), x, y) draws correctly (the base blit takes the tuple form MicroPython's framebuf accepts), then raises AttributeError: 'tuple' object has no attribute 'width' computing the Area it returns. clip_blit_bounds now reads the width and height from a tuple too.

Found running pydevices-examples' spectrum meter on Windows python.exe with the pygraphics source tree on the path (SpectrumView._build_bar_columns). A new test covers the tuple form, including the fully-clipped case. It fails without the fix, and the suite passes with it (104 tests, 8 skipped).

framebuf.blit takes (buffer, width, height, format), and FrameBuffer.blit
passed it through to the base blit fine, then read source.width for the Area
it returns and raised AttributeError. The spectrum example hit it on
python.exe with the source tree on the path.
@bdbarnett
bdbarnett merged commit 6d9cc79 into main Sep 26, 2026
3 checks passed
@bdbarnett
bdbarnett deleted the fix/blit-tuple-source branch September 26, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant