From 6412d971facb6c0c75aaced897f39dc0a7d17bb2 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Sun, 11 Dec 2022 02:44:35 +0100 Subject: [PATCH] displayio: Set in_group to false when removing a layer from a group Otherwise the removed layer cannot be re-added. --- shared-module/displayio/Group.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index ad45852379..7eec72404f 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -310,6 +310,7 @@ static void _remove_layer(displayio_group_t *self, size_t index) { self->members->items[index], &displayio_tilegrid_type); if (layer != MP_OBJ_NULL) { displayio_tilegrid_t *tilegrid = layer; + tilegrid->in_group = false; rendered_last_frame = displayio_tilegrid_get_previous_area(tilegrid, &layer_area); displayio_tilegrid_update_transform(tilegrid, NULL); } @@ -317,6 +318,7 @@ static void _remove_layer(displayio_group_t *self, size_t index) { self->members->items[index], &displayio_group_type); if (layer != MP_OBJ_NULL) { displayio_group_t *group = layer; + group->in_group = false; rendered_last_frame = displayio_group_get_previous_area(group, &layer_area); displayio_group_update_transform(group, NULL); }