[evince] libview: Fix rendering of the first visible page while resizing



commit 72f2ae4065bb82728a29bc8a793adadd225e5c73
Author: Josà Aliste <jaliste src gnome org>
Date:   Fri Feb 8 20:18:04 2013 +0100

    libview: Fix rendering of the first visible page while resizing
    
    While we are resizing the view widget and waiting for a new
    surface rendered at the right size, we use old surfaces
    scaled to match the target size. When the begining of a page is not visible,
    the scaled surfaces are not placed correctly.

 libview/ev-view.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index b2ff908..4a2b7bf 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -4425,11 +4425,16 @@ draw_surface (cairo_t 	      *cr,
 	cairo_translate (cr, x, y);
 
 	if (width != target_width || height != target_height) {
+		gdouble scale_x, scale_y;
+
+		scale_x = (gdouble)target_width / width;
+		scale_y = (gdouble)target_height / height;
 		cairo_pattern_set_filter (cairo_get_source (cr),
 					  CAIRO_FILTER_FAST);
-		cairo_scale (cr,
-			     (gdouble)target_width / width,
-			     (gdouble)target_height / height);
+		cairo_scale (cr, scale_x, scale_y);
+
+		offset_x /= scale_x;
+		offset_y /= scale_y;
 	}
 
 	cairo_surface_set_device_offset (surface,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]