[gtk+/wip/otte/vulkan: 33/42] cssgadget: Compute relative to own allocation, not widget allocation



commit 72e1302db6791d4271ce14f9ed69b1cdac3519c3
Author: Benjamin Otte <otte redhat com>
Date:   Tue Nov 29 11:32:45 2016 +0100

    cssgadget: Compute relative to own allocation, not widget allocation
    
    This would lead to clipped gadgets when the gadget allocation differed
    from the widget allocation, like in GtkListBox.

 gtk/gtkcssgadget.c |   18 +++---------------
 1 files changed, 3 insertions(+), 15 deletions(-)
---
diff --git a/gtk/gtkcssgadget.c b/gtk/gtkcssgadget.c
index 64b3506..85a2d7f 100644
--- a/gtk/gtkcssgadget.c
+++ b/gtk/gtkcssgadget.c
@@ -127,21 +127,9 @@ gtk_css_gadget_get_clip (GtkCssGadget    *gadget,
 {
   GtkCssGadgetPrivate *priv = gtk_css_gadget_get_instance_private (gadget);
 
-  if (priv->owner && !gtk_widget_get_has_window (priv->owner))
-    {
-      GtkAllocation widget_alloc;
-      gtk_widget_get_allocation (priv->owner, &widget_alloc);
-
-      graphene_rect_init (bounds,
-                          priv->clip.x - widget_alloc.x, priv->clip.y - widget_alloc.y,
-                          priv->clip.width, priv->clip.height);
-    }
-  else
-    {
-      graphene_rect_init (bounds,
-                          priv->clip.x, priv->clip.y,
-                          priv->clip.width, priv->clip.height);
-    }
+  graphene_rect_init (bounds,
+                      priv->clip.x - priv->allocated_size.x, priv->clip.y - priv->allocated_size.y,
+                      priv->clip.width, priv->clip.height);
 }
 
 static gboolean


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]