- cairo_translate (cr, overlap.x, overlap.y);
- cairo_surface_set_device_offset (surface,
- overlap.x - page_area.x,
- overlap.y - page_area.y);
- cairo_set_source_surface (cr, surface, 0, 0);
- cairo_paint (cr);
+ /* Try to fix rounding errors. See bug #438760 */
+ if (overlap.width == page_area.width)
+ overlap.width--;
+
+ cairo_rectangle (cr, overlap.x, overlap.y, overlap.width, overlap.height);
+ cairo_set_source_surface (cr, surface, page_area.x, page_area.y);
+ cairo_fill (cr);