[evolution/gtk3] GnomeCanvas scrolled draw fix



commit 20724fa5058d2b52ac6e9a53b8b1efb347d82c42
Author: Milan Crha <mcrha redhat com>
Date:   Fri Jan 21 17:20:51 2011 +0100

    GnomeCanvas scrolled draw fix

 libgnomecanvas/gnome-canvas.c |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c
index 08567bb..c97c31e 100644
--- a/libgnomecanvas/gnome-canvas.c
+++ b/libgnomecanvas/gnome-canvas.c
@@ -2276,10 +2276,26 @@ gnome_canvas_draw (GtkWidget *widget,
                                              rect.x + rect.width,
                                              rect.y + rect.height);
         } else {
+		GtkLayout *layout;
+		GtkAdjustment *hadjustment;
+		GtkAdjustment *vadjustment;
+		gdouble hadjustment_value;
+		gdouble vadjustment_value;
+
+		layout = GTK_LAYOUT (canvas);
+		hadjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (layout));
+		vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (layout));
+
+		hadjustment_value = gtk_adjustment_get_value (hadjustment);
+		vadjustment_value = gtk_adjustment_get_value (vadjustment);
+
                 cairo_save (cr);
                 cairo_translate (cr,
-                                 - canvas->zoom_xofs,
-                                 - canvas->zoom_yofs);
+                                 -canvas->zoom_xofs + rect.x,
+                                 -canvas->zoom_yofs + rect.y);
+
+		rect.x += hadjustment_value;
+		rect.y += vadjustment_value;
 
                 /* No pending updates, draw exposed area immediately */
                 gnome_canvas_paint_rect (canvas, cr,
@@ -2293,7 +2309,7 @@ gnome_canvas_draw (GtkWidget *widget,
                         draw (widget, cr);
         }
 
-return FALSE;
+	return FALSE;
 }
 
 /* Emits an event for an item in the canvas, be it the current item, grabbed



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