[evince] libview: Keep the scroll position when switching between continuous and non continuous mode



commit b40260c2ffa462a7726a3a0e817dce30fa9ad7c1
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Sat Mar 1 20:28:09 2014 +0100

    libview: Keep the scroll position when switching between continuous and non continuous mode
    
    https://bugzilla.gnome.org/show_bug.cgi?id=554843

 libview/ev-view.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index c71c1e5..9813cbf 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -7169,6 +7169,19 @@ ev_view_continuous_changed_cb (EvDocumentModel *model,
 {
        gboolean continuous = ev_document_model_get_continuous (model);
 
+       if (view->document) {
+               GdkPoint     view_point;
+               GdkRectangle page_area;
+               GtkBorder    border;
+
+               view_point.x = view->scroll_x;
+               view_point.y = view->scroll_y;
+               ev_view_get_page_extents (view, view->start_page, &page_area, &border);
+               _ev_view_transform_view_point_to_doc_point (view, &view_point,
+                                                           &page_area, &border,
+                                                           &view->pending_point.x,
+                                                           &view->pending_point.y);
+       }
        view->continuous = continuous;
        view->pending_scroll = SCROLL_TO_PAGE_POSITION;
        gtk_widget_queue_resize (GTK_WIDGET (view));


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