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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy