8000 Merge pull request #3214 from kmatch98/bitmap_write · cwalther/circuitpython@05a1519 · GitHub
[go: up one dir, main page]

Skip to content

Commit 05a1519

Browse files
authored
Merge pull request adafruit#3214 from kmatch98/bitmap_write
Updated Group.c to correct bug with insert into displayio.Group
2 parents 5cb7e64 + 0887bc2 commit 05a1519

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

shared-bindings/displayio/Group.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_append_obj, displayio_group_obj_append
207207
//|
208208
STATIC mp_obj_t displayio_group_obj_insert(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t layer) {
209209
displayio_group_t *self = native_group(self_in);
210+
if ((size_t) MP_OBJ_SMALL_INT_VALUE(index_obj) == common_hal_displayio_group_get_len(self)){
211+
return displayio_group_obj_append(self_in, layer);
212+
}
210213
size_t index = mp_get_index(&displayio_group_type, common_hal_displayio_group_get_len(self), index_obj, false);
211214
common_hal_displayio_group_insert(self, index, layer);
212215
return mp_const_none;

0 commit comments

Comments
 (0)
0