[gnome-builder] rg: fix drawing locations when not at window origin



commit 88f824d6329c74b199b178796c0baa98646c3afc
Author: Christian Hergert <christian hergert me>
Date:   Mon Jun 1 22:27:53 2015 -0700

    rg: fix drawing locations when not at window origin
    
    If we are sharing a GdkWindow with other widgets (such as in a Box), we
    might not be at an origin of 0,0. This fixes rendering in that situation.

 contrib/rg/rg-graph.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/contrib/rg/rg-graph.c b/contrib/rg/rg-graph.c
index 238f631..1c4d9db 100644
--- a/contrib/rg/rg-graph.c
+++ b/contrib/rg/rg-graph.c
@@ -180,7 +180,7 @@ rg_graph_ensure_surface (RgGraph *self)
       cr = cairo_create (priv->surface);
 
       cairo_save (cr);
-      gdk_cairo_rectangle (cr, &alloc);
+      cairo_rectangle (cr, 0, 0, alloc.width, alloc.height);
       cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
       cairo_fill (cr);
       cairo_restore (cr);
@@ -241,7 +241,7 @@ rg_graph_draw (GtkWidget *widget,
 
   cairo_save (cr);
   cairo_set_source_surface (cr, priv->surface, priv->x_offset, 0);
-  gdk_cairo_rectangle (cr, &alloc);
+  cairo_rectangle (cr, 0, 0, alloc.width, alloc.height);
   cairo_fill (cr);
   cairo_restore (cr);
 


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