From 48602e500c25dfe1cefeef65ec0c8085da954498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 28 Oct 2016 14:31:43 +0200 Subject: [PATCH] cssgadget: Move gadgets to their allocated position --- gtk/gtkcssgadget.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gtk/gtkcssgadget.c b/gtk/gtkcssgadget.c index fbf9e2351a..d7eac83fc7 100644 --- a/gtk/gtkcssgadget.c +++ b/gtk/gtkcssgadget.c @@ -827,13 +827,17 @@ gtk_css_gadget_get_render_node (GtkCssGadget *gadget, int contents_x, contents_y, contents_width, contents_height; GtkAllocation margin_box; GtkAllocation clip_box; + GtkAllocation owner_alloc; char *str; + graphene_matrix_t m; + graphene_point3d_t p; if (!gtk_css_gadget_get_visible (gadget)) return NULL; margin_box = priv->allocated_size; clip_box = priv->clip; + gtk_widget_get_allocation (gtk_css_gadget_get_owner (gadget), &owner_alloc); width = clip_box.width; height = clip_box.height; @@ -859,6 +863,10 @@ gtk_css_gadget_get_render_node (GtkCssGadget *gadget, box_node = gsk_renderer_create_render_node (renderer); gsk_render_node_set_name (box_node, str); gsk_render_node_set_bounds (box_node, &bounds); + graphene_matrix_init_translate (&m, graphene_point3d_init (&p, + clip_box.x - owner_alloc.x, + clip_box.y - owner_alloc.y, 0)); + gsk_render_node_set_transform (box_node, &m); g_free (str); style = gtk_css_gadget_get_style (gadget);