change direction of shift right

This commit is contained in:
caternuson 2019-04-03 09:21:34 -07:00
parent 19278e0284
commit 5298119aa2

View File

@ -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;