aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
authorlecoanet2007-09-07 14:02:46 +0000
committerlecoanet2007-09-07 14:02:46 +0000
commitfd62652445f30a6aab602ba1a6b5454b8ed6537b (patch)
tree24bc7bd95443fffbdea4ecf5492820d0fcbd4788 /generic
parent69a9aaea31de13274865e28da091853994013bf9 (diff)
downloadtkzinc-fd62652445f30a6aab602ba1a6b5454b8ed6537b.zip
tkzinc-fd62652445f30a6aab602ba1a6b5454b8ed6537b.tar.gz
tkzinc-fd62652445f30a6aab602ba1a6b5454b8ed6537b.tar.bz2
tkzinc-fd62652445f30a6aab602ba1a6b5454b8ed6537b.tar.xz
The group bbox didn't take care of the items visibilty
status resulting in wrong sized cumulative bboxes. The group has to be warned when an item visibility change. Both cases are handled by this patch.
Diffstat (limited to 'generic')
-rw-r--r--generic/Group.c4
-rw-r--r--generic/Item.c17
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, &current_item->item_bounding_box);
+ if (ISSET(current_item->flags, ZN_VISIBLE_BIT)) {
+ ZnAddBBoxToBBox(&item->item_bounding_box, &current_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);