Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2010-01-04 12:11:46 (GMT)
committer Carlos Garcia Campos <carlosgc@gnome.org>2010-01-04 12:11:46 (GMT)
commit0981b6257ec356fd5fb0dac919640f3af41c2351 (patch)
treef328e94c817ecd8371e69a24ffb4acf63f4870ae
parent64f51544a23ca0819f111ad25677b951b9d4b45c (diff)
[presentation] Fix vertical white line in documents with black background
We never show the last vertical line since it's usually wrong due to rounding errors. Fixes bug #438760.
-rw-r--r--libview/ev-view-presentation.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libview/ev-view-presentation.c b/libview/ev-view-presentation.c
index c516602..24a8801 100644
--- a/libview/ev-view-presentation.c
+++ b/libview/ev-view-presentation.c
@@ -1039,6 +1039,9 @@ ev_view_presentation_expose_event (GtkWidget *widget,
cairo_translate (cr, page_area.x, page_area.y);
page_area.x = page_area.y = 0;
+ /* Try to fix rounding errors */
+ page_area.width--;
+
ev_transition_animation_paint (pview->animation, cr, page_area);
cairo_destroy (cr);
}
@@ -1059,12 +1062,13 @@ ev_view_presentation_expose_event (GtkWidget *widget,
if (gdk_rectangle_intersect (&page_area, &(event->area), &overlap)) {
cr = gdk_cairo_create (widget->window);
- 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);
cairo_destroy (cr);
}