From 310f2ccdf4c07bb2c99d7cbe9bc627299f1f3a3e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 16 Mar 2020 10:09:46 -0500 Subject: [PATCH] Pixelbuf: subscr: Get correct pixel value Previously, the 0th pixel's value was always returned --- shared-module/_pixelbuf/PixelBuf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared-module/_pixelbuf/PixelBuf.c b/shared-module/_pixelbuf/PixelBuf.c index bad8539ea8..31350b875c 100644 --- a/shared-module/_pixelbuf/PixelBuf.c +++ b/shared-module/_pixelbuf/PixelBuf.c @@ -243,6 +243,7 @@ mp_obj_t common_hal__pixelbuf_pixelbuf_get_pixel(mp_obj_t self_in, size_t index) if (self->pre_brightness_buffer != NULL) { pixel_buffer = self->pre_brightness_buffer; } + pixel_buffer += self->byteorder.bpp * index; pixelbuf_rgbw_t *rgbw_order = &self->byteorder.byteorder; elems[0] = MP_OBJ_NEW_SMALL_INT(pixel_buffer[rgbw_order->r]);