diff options
author | Timm Bäder <mail@baedert.org> | 2017-04-23 16:32:28 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2017-04-25 13:05:27 +0200 |
commit | 18672fd61689f07b5e3577a65ac059e61f90dc24 (patch) | |
tree | 6667137cdc817ebf50c597083c7e39679d56b71a | |
parent | 98b3c56a757f2961786fc8fa88ad98decaba2dda (diff) | |
download | gtk+-18672fd61689f07b5e3577a65ac059e61f90dc24.tar.gz |
box: Compute clips directly
Instead of using _gtk_widget_set_simple_clip *and*
gtk_container_get_children_clip
-rw-r--r-- | gtk/gtkbox.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index 81e5f94929..d2fa3f8095 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -406,7 +406,8 @@ get_spacing (GtkBox *box) static void gtk_box_size_allocate_no_center (GtkWidget *widget, - const GtkAllocation *allocation) + const GtkAllocation *allocation, + GdkRectangle *out_clip) { GtkBox *box = GTK_BOX (widget); GtkBoxPrivate *private = box->priv; @@ -433,6 +434,7 @@ gtk_box_size_allocate_no_center (GtkWidget *widget, gint x = 0, y = 0, i; gint child_size; gint spacing; + GdkRectangle clip; count_expand_children (box, &nvis_children, &nexpand_children); @@ -707,12 +709,12 @@ gtk_box_size_allocate_no_center (GtkWidget *widget, } } gtk_widget_size_allocate_with_baseline (child->widget, &child_allocation, baseline); + gtk_widget_get_clip (child->widget, &clip); + gdk_rectangle_union (out_clip, out_clip, &clip); i++; } } - - _gtk_widget_set_simple_clip (widget, NULL); } static void @@ -723,11 +725,9 @@ gtk_box_allocate_contents (GtkCssGadget *gadget, gpointer unused) { GtkWidget *widget = gtk_css_gadget_get_owner (gadget); - GtkBox *box = GTK_BOX (widget); - gtk_box_size_allocate_no_center (widget, allocation); - - gtk_container_get_children_clip (GTK_CONTAINER (box), out_clip); + *out_clip = *allocation; + gtk_box_size_allocate_no_center (widget, allocation, out_clip); } static void @@ -743,7 +743,7 @@ gtk_box_size_allocate (GtkWidget *widget, allocation, gtk_widget_get_allocated_baseline (widget), &clip); - + gtk_widget_set_clip (widget, &clip); } |