Merge pull request #4915 from Neradoc/fix-4193

Fix 4193 - set hidden_by_parent when adding to displayio group
This commit is contained in:
Scott Shawcroft 2021-06-24 15:23:33 -07:00 committed by GitHub
commit 57f898b774
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -258,6 +258,8 @@ static void _add_layer(displayio_group_t *self, mp_obj_t layer) {
tilegrid->in_group = true; tilegrid->in_group = true;
} }
displayio_tilegrid_update_transform(tilegrid, &self->absolute_transform); displayio_tilegrid_update_transform(tilegrid, &self->absolute_transform);
displayio_tilegrid_set_hidden_by_parent(
tilegrid, self->hidden || self->hidden_by_parent);
return; return;
} }
native_layer = mp_obj_cast_to_native_base(layer, &displayio_group_type); native_layer = mp_obj_cast_to_native_base(layer, &displayio_group_type);
@ -269,6 +271,8 @@ static void _add_layer(displayio_group_t *self, mp_obj_t layer) {
group->in_group = true; group->in_group = true;
} }
displayio_group_update_transform(group, &self->absolute_transform); displayio_group_update_transform(group, &self->absolute_transform);
displayio_group_set_hidden_by_parent(
group, self->hidden || self->hidden_by_parent);
return; return;
} }
mp_raise_ValueError(translate("Layer must be a Group or TileGrid subclass.")); mp_raise_ValueError(translate("Layer must be a Group or TileGrid subclass."));