diff --git a/libgnomecanvas.spec b/libgnomecanvas.spec index c67cae4..fdbf18d 100644 --- a/libgnomecanvas.spec +++ b/libgnomecanvas.spec @@ -8,9 +8,11 @@ Summary: GnomeCanvas widget Name: libgnomecanvas Version: 2.20.1 -Release: 1%{?dist} +Release: 2%{?dist} URL: http://www.gnome.org/ Source0: http://download.gnome.org/sources/libgnomecanvas/2.20/%{name}-%{version}.tar.bz2 +Patch0: libgnomecanvas-2.19.2-avoid-tearing.patch +Patch1: zoom-redraw-fix.patch License: LGPLv2+ Group: System Environment/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -47,6 +49,8 @@ Tk canvas widget but has evolved quite a bit over time. %prep %setup -q +%patch0 -p1 -b .avoid-tearing +%patch1 -p1 -b .zoom-redraw-fix %build export CFLAGS=$(echo $RPM_OPT_FLAGS |sed -e 's/O2/O1/g') @@ -87,6 +91,9 @@ rm -rf %{buildroot} %{_datadir}/gtk-doc/html/libgnomecanvas %changelog +* Mon Nov 12 2007 Matthias Clasen 2.20.1-2 +- Readd the scrolling patch, with an extra fix for redraw problems + * Mon Oct 15 2007 Matthias Clasen 2.20.1-1 - Update to 2.20.1 (translation updates) diff --git a/zoom-redraw-fix.patch b/zoom-redraw-fix.patch new file mode 100644 index 0000000..fe109b5 --- /dev/null +++ b/zoom-redraw-fix.patch @@ -0,0 +1,53 @@ +2007-11-05 Federico Mena Quintero + + 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 */