8000 extmod/modframebuf: Fix pixel accessor to return a 1-bit result. · danni/micropython@531217a · GitHub
[go: up one dir, main page]

Skip to content

Commit 531217a

Browse files
committed
extmod/modframebuf: Fix pixel accessor to return a 1-bit result.
1 parent fea7fe4 commit 531217a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extmod/modframebuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ STATIC mp_obj_t framebuf1_pixel(size_t n_args, const mp_obj_t *args) {
8383
int index = (y / 8) * self->stride + x;
8484
if (n_args == 3) {
8585
// get
86-
return MP_OBJ_NEW_SMALL_INT(self->buf[index] >> (y & 7));
86+
return MP_OBJ_NEW_SMALL_INT((self->buf[index] >> (y & 7)) & 1);
8787
} else {
8888
// set
8989
if (mp_obj_get_int(args[3])) {

0 commit comments

Comments
 (0)
0