mirror of
https://github.com/micropython/micropython.git
synced 2026-01-08 21:20:13 +01:00
extmod/modframebuf: Fix FrameBuffer get-buffer implementation.
This wasn't correctly accounting for the bits-per-pixel and was returning a bufinfo struct with the incorrect length. Instead, just forward directly to the underlying buffer object. Fixes issue #12563. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
committed by
Damien George
parent
d040478d8a
commit
03a9fa227d
@@ -109,3 +109,9 @@ except ValueError:
|
||||
fbuf = framebuf.FrameBuffer1(buf, w, h)
|
||||
fbuf = framebuf.FrameBuffer1(buf, w, h, w)
|
||||
print(framebuf.MVLSB == framebuf.MONO_VLSB)
|
||||
|
||||
# test get-buffer (returns the original buffer)
|
||||
fbuf = framebuf.FrameBuffer(bytearray(2), 8, 1, framebuf.MONO_HLSB)
|
||||
fbuf.pixel(0, 0, 1)
|
||||
fbuf.pixel(4, 0, 1)
|
||||
print(bytearray(fbuf))
|
||||
|
||||
@@ -66,3 +66,4 @@ bytearray(b'\n\x15\n\x15\n\x15\n\x15\x00\x00\x00\x00\x00\x00\x00\x00')
|
||||
|
||||
ValueError
|
||||
True
|
||||
bytearray(b'\x88\x00')
|
||||
|
||||
Reference in New Issue
Block a user