You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libgnomecanvas/zoom-redraw-fix.patch

54 lines
1.9 KiB

2007-11-05 Federico Mena Quintero <federico@novell.com>
Fix these bugs:
http://bugzilla.gnome.org/show_bug.cgi?id=493808
https://bugzilla.novell.com/show_bug.cgi?id=336941
* libgnomecanvas/gnome-canvas.c (paint): Oops, use the correct
visible rectangle; we forgot to take the zoom_{x,y}ofs into
account. Also, take those offsets into account when generating
the actual rectangle to be added to the GdkRegion.
diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c
index 5e89bc2..ca9769f 100644
--- a/libgnomecanvas/gnome-canvas.c
+++ b/libgnomecanvas/gnome-canvas.c
@@ -3040,6 +3040,7 @@ gnome_canvas_expose (GtkWidget *widget, GdkEventExpose *event)
if (canvas->need_update || canvas->need_redraw) {
ArtUta *uta;
+
/* Update or drawing is scheduled, so just mark exposed area as dirty */
uta = art_uta_from_irect (&rect);
gnome_canvas_request_redraw_uta (canvas, uta);
@@ -3082,8 +3083,8 @@ paint (GnomeCanvas *canvas)
/* Turn those rectangles into a GdkRegion for exposing */
- visible_rect.x0 = canvas->layout.hadjustment->value;
- visible_rect.y0 = canvas->layout.vadjustment->value;
+ visible_rect.x0 = canvas->layout.hadjustment->value - canvas->zoom_xofs;
+ visible_rect.y0 = canvas->layout.vadjustment->value - canvas->zoom_yofs;
visible_rect.x1 = visible_rect.x0 + GTK_WIDGET (canvas)->allocation.width;
visible_rect.y1 = visible_rect.y0 + GTK_WIDGET (canvas)->allocation.height;
@@ -3096,8 +3097,8 @@ paint (GnomeCanvas *canvas)
if (!art_irect_empty (&clipped)) {
GdkRectangle gdkrect;
- gdkrect.x = clipped.x0;
- gdkrect.y = clipped.y0;
+ gdkrect.x = clipped.x0 + canvas->zoom_xofs;
+ gdkrect.y = clipped.y0 + canvas->zoom_yofs;
gdkrect.width = clipped.x1 - clipped.x0;
gdkrect.height = clipped.y1 - clipped.y0;
@@ -3200,6 +3201,7 @@ idle_handler (gpointer data)
GDK_THREADS_ENTER ();
canvas = GNOME_CANVAS (data);
+
do_update (canvas);
/* Reset idle id */