Skip to content

Commit 54a38fd

Browse files
authored
Merge pull request #2936 from dunkmann00/pixelbuf-slice-fix
Fix error when getting a pixelbuf slice
2 parents 709d323 + 02d0881 commit 54a38fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shared-bindings/_pixelbuf/PixelBuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp
311311
}
312312
mp_obj_tuple_t* t = MP_OBJ_TO_PTR(mp_obj_new_tuple(len, NULL));
313313
for (uint i = 0; i < len; i++) {
314-
t->items[i] = common_hal__pixelbuf_pixelbuf_get_pixel(self_in, i * slice.step);
314+
t->items[i] = common_hal__pixelbuf_pixelbuf_get_pixel(self_in, i * slice.step + slice.start);
315315
}
316316
return MP_OBJ_FROM_PTR(t);
317317
} else { // Set

0 commit comments

Comments
 (0)