[gtk+] cssgadget: Compute clip correctly
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] cssgadget: Compute clip correctly
- Date: Mon, 9 Jan 2017 00:12:47 +0000 (UTC)
commit dcb15d67287f17528b3a5fb0bc260a8e28a99a84
Author: Benjamin Otte <otte redhat com>
Date: Mon Jan 9 01:10:22 2017 +0100
cssgadget: Compute clip correctly
We were computing it relative to the gadget allocation, but it should be
relative to the widget allocation.
gtk/gtkcssgadget.c | 19 ++++---------------
1 files changed, 4 insertions(+), 15 deletions(-)
---
diff --git a/gtk/gtkcssgadget.c b/gtk/gtkcssgadget.c
index f25191b..4d49185 100644
--- a/gtk/gtkcssgadget.c
+++ b/gtk/gtkcssgadget.c
@@ -110,17 +110,6 @@ gtk_css_gadget_real_allocate (GtkCssGadget *gadget,
*out_clip = *allocation;
}
-static void
-gtk_css_gadget_get_clip (GtkCssGadget *gadget,
- graphene_rect_t *bounds)
-{
- GtkCssGadgetPrivate *priv = gtk_css_gadget_get_instance_private (gadget);
-
- 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
gtk_css_gadget_real_snapshot (GtkCssGadget *gadget,
GtkSnapshot *snapshot,
@@ -837,14 +826,14 @@ gtk_css_gadget_snapshot (GtkCssGadget *gadget,
GtkCssStyle *style;
int x, y, width, height;
int contents_x, contents_y, contents_width, contents_height;
- GtkAllocation margin_box;
- graphene_rect_t bounds;
+ GtkAllocation margin_box, clip;
if (!gtk_css_gadget_get_visible (gadget))
return;
- gtk_css_gadget_get_clip (gadget, &bounds);
- if (gtk_snapshot_clips_rect (snapshot, &bounds))
+ clip = priv->clip;
+ shift_allocation (gadget, &clip);
+ if (gtk_snapshot_clips_rect (snapshot, &GRAPHENE_RECT_INIT(clip.x, clip.y, clip.width, clip.height)))
return;
gtk_css_gadget_get_margin_box (gadget, &margin_box);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]