commit d7c4568c51f9119f3c2921cbd73968b8b833d39e
Author: Matthew Barnes <mbarnes@redhat.com>
Date:   Mon Oct 25 17:07:57 2010 -0400

    Fix image positioning.

diff --git a/gtkhtml/htmlgdkpainter.c b/gtkhtml/htmlgdkpainter.c
index ed7f21d..d511285 100644
--- a/gtkhtml/htmlgdkpainter.c
+++ b/gtkhtml/htmlgdkpainter.c
@@ -582,11 +582,11 @@ draw_pixmap (HTMLPainter *painter,
 
 	if (scale_width == orig_width && scale_height == orig_height && color == NULL) {
 		gdk_cairo_set_source_pixbuf (gdk_painter->cr, pixbuf,
-					     paint.x - image.x,
-					     paint.y - image.y);
+					     image.x - clip.x,
+					     image.y - clip.y);
 		cairo_rectangle (gdk_painter->cr,
-				 paint.x - clip.x, paint.y - clip.y,
-				 paint.width, paint.height);
+				 image.x - clip.x, image.y - clip.y,
+				 image.width, image.height);
 		cairo_fill (gdk_painter->cr);
 		return;
 	}
@@ -594,7 +594,7 @@ draw_pixmap (HTMLPainter *painter,
 	tmp_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
 				     gdk_pixbuf_get_has_alpha (pixbuf),
 				     gdk_pixbuf_get_bits_per_sample (pixbuf),
-				     paint.width, paint.height);
+				     image.width, image.height);
 
 	gdk_pixbuf_fill (tmp_pixbuf, 0xff000000);
 
@@ -612,9 +612,9 @@ draw_pixmap (HTMLPainter *painter,
 	gdk_pixbuf_composite (pixbuf, tmp_pixbuf,
 			      0,
 			      0,
-			      paint.width, paint.height,
-			      (double)-(paint.x - image.x),
-			      (double)-(paint.y - image.y),
+			      image.width, image.height,
+			      (double) 0.,
+			      (double) 0.,
 			      (gdouble) scale_width/ (gdouble) orig_width,
 			      (gdouble) scale_height/ (gdouble) orig_height,
 			      bilinear ? GDK_INTERP_BILINEAR : GDK_INTERP_NEAREST,
@@ -626,10 +626,10 @@ draw_pixmap (HTMLPainter *painter,
 
 		n_channels = gdk_pixbuf_get_n_channels (tmp_pixbuf);
 		q = gdk_pixbuf_get_pixels (tmp_pixbuf);
-		for (i = 0; i < paint.height; i++) {
+		for (i = 0; i < image.height; i++) {
 			guchar *p = q;
 
-			for (j = 0; j < paint.width; j++) {
+			for (j = 0; j < image.width; j++) {
 				gint r, g, b, a;
 
 				if (n_channels > 3)
@@ -656,10 +656,11 @@ draw_pixmap (HTMLPainter *painter,
 	}
 
 	gdk_cairo_set_source_pixbuf (gdk_painter->cr, tmp_pixbuf,
-				     0, 0);
+				     image.x - clip.x,
+				     image.y - clip.y);
 	cairo_rectangle (gdk_painter->cr,
-			 paint.x - clip.x, paint.y - clip.y,
-			 paint.width, paint.height);
+			 image.x - clip.x, image.y - clip.y,
+			 image.width, image.height);
 	cairo_fill (gdk_painter->cr);
 	g_object_unref (tmp_pixbuf);
 }
