diff options
-rw-r--r-- | generic/Group.c | 4 | ||||
-rw-r--r-- | generic/Item.c | 17 |
2 files changed, 14 insertions, 7 deletions
diff --git a/generic/Group.c b/generic/Group.c index 9249adc..6031811 100644 --- a/generic/Group.c +++ b/generic/Group.c @@ -795,7 +795,9 @@ ComputeCoordinates(ZnItem item, ZnResetBBox(&item->item_bounding_box); current_item = group->head; while (current_item != ZN_NO_ITEM) { - ZnAddBBoxToBBox(&item->item_bounding_box, ¤t_item->item_bounding_box); + if (ISSET(current_item->flags, ZN_VISIBLE_BIT)) { + ZnAddBBoxToBBox(&item->item_bounding_box, ¤t_item->item_bounding_box); + } current_item = current_item->next; } /* diff --git a/generic/Item.c b/generic/Item.c index 6739e0e..a9fec0b 100644 --- a/generic/Item.c +++ b/generic/Item.c @@ -1804,12 +1804,17 @@ ConfigureItem(ZnItem item, } } - if (previous_visible && ISCLEAR(item->flags, ZN_VISIBLE_BIT)) { - /* - * Special case when the item has its visibility - * just turned out. - */ - ZnDamage(wi, &item->item_bounding_box); + // + // If visibility changed. + if (previous_visible ^ ISSET(item->flags, ZN_VISIBLE_BIT)) { + // First must force an update of the parent geometry (bbox). + Invalidate(item, ZN_COORDS_FLAG); + // + // Special case when the item has its visibility + // just turned out. + if (ISCLEAR(item->flags, ZN_VISIBLE_BIT)) { + ZnDamage(wi, &item->item_bounding_box); + } } Invalidate(item, flags); |