[evince/gnome-3-38] libview: forgo setting device offset on page surfaces



commit 7d348fa4bc2972217f59e74614bc29388149f7bc
Author: Andrew Mayorov <encube ul gmail com>
Date:   Sat Feb 6 21:34:45 2021 +0300

    libview: forgo setting device offset on page surfaces
    
    I believe that passing unscaled offset coordinates to cairo_set_source_surface
    during a process of drawing a page _effectively_ does the same transformation.
    
    Also this fixes link preview popups when a link is on the currently viewed
    page, because the solution introduced in commit caad329a did not account for
    nonzero device offsets. Without this patch any preview of a link referring
    to the current page would go completely black when the page is scrolled at
    least popup's height pixels down.

 libview/ev-view.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index eaac1d96..bff7aa1d 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -7397,10 +7397,7 @@ draw_surface (cairo_t          *cr,
                offset_y /= scale_y;
        }
 
-       cairo_surface_set_device_offset (surface,
-                                        offset_x * device_scale_x,
-                                        offset_y * device_scale_y);
-       cairo_set_source_surface (cr, surface, 0, 0);
+       cairo_set_source_surface (cr, surface, -offset_x, -offset_y);
        cairo_paint (cr);
        cairo_restore (cr);
 }


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