Merge pull request #1740 from caternuson/iss1739_insert
Fix shift right in displayio.Group
This commit is contained in:
commit
9bfa625170
|
@ -73,8 +73,8 @@ void common_hal_displayio_group_insert(displayio_group_t* self, size_t index, mp
|
|||
mp_raise_ValueError(translate("Layer must be a Group or TileGrid subclass."));
|
||||
}
|
||||
// Shift everything right.
|
||||
for (size_t i = index; i < self->size; i++) {
|
||||
self->children[i + 1] = self->children[i];
|
||||
for (size_t i = self->size; i > index; i--) {
|
||||
self->children[i] = self->children[i - 1];
|
||||
}
|
||||
self->children[index].native = native_layer;
|
||||
self->children[index].original = layer;
|
||||
|
|
Loading…
Reference in New Issue