]> www.fi.muni.cz Git - evince.git/commitdiff
[libview] Fix rendering issue in dual/continuous mode
authorJosé Aliste <jose.aliste@gmail.com>
Wed, 25 Nov 2009 11:49:52 +0000 (12:49 +0100)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Wed, 25 Nov 2009 11:49:52 +0000 (12:49 +0100)
Fixes bgo#602742.

libview/ev-view.c

index 91ce47087cc8c92ad8fa1732ba0fba35bbb234d3..28c8f822dbd8292e14e9122a779a45668966aad8 100644 (file)
@@ -622,13 +622,13 @@ view_update_range_and_current_page (EvView *view)
                gboolean found = FALSE;
                gint area_max = -1, area;
                gint best_current_page = -1;
-               int i;
+               int i, j = 0;
 
                if (!(view->vadjustment && view->hadjustment))
                        return;
 
                current_area.x = view->hadjustment->value;
-               current_area.width = view->hadjustment->upper;
+               current_area.width = view->hadjustment->page_size;
                current_area.y = view->vadjustment->value;
                current_area.height = view->vadjustment->page_size;
 
@@ -651,7 +651,15 @@ view_update_range_and_current_page (EvView *view)
                                }
 
                                view->end_page = i;
+                               j = 0;
                        } else if (found && view->current_page <= view->end_page) {
+                               if (view->dual_page && j < 1) {
+                                       /* In dual mode  we stop searching
+                                        * after two consecutive non-visible pages.
+                                        */
+                                       j++;
+                                       continue;
+                               }
                                break;
                        }
                }