[evince/390-to-move-to-the-next-prev-line-using-the-caret-cursor-loops-on-the-same-page-in-non-continous-mode: 2/2] ev-view.c: keep cursor visible when changing pages



commit 6fa8e07fc562ac823ac7f5ffd508aacbad9f0a10
Author: Jason Crain <jcrain src gnome org>
Date:   Thu Oct 18 11:03:54 2018 -0600

    ev-view.c: keep cursor visible when changing pages
    
    When zoomed in in non-continuous mode, the caret cursor is sometimes not
    visible after moving it to the next or previous page with the up and
    down arrow keys.
    
    Call `_ev_view_ensure_rectangle_is_visible` when changing to the next
    page, not only when changing to the previous page. Adjust `rect` for
    the coordinate difference between the window and the view's scrolling
    position.

 libview/ev-view.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 03bf17a1..805744ef 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -6593,6 +6593,9 @@ ev_view_move_cursor (EvView         *view,
                }
 
                if (changed_page) {
+                       rect.x += view->scroll_x;
+                       rect.y += view->scroll_y;
+                       _ev_view_ensure_rectangle_is_visible (view, &rect);
                        g_signal_emit (view, signals[SIGNAL_CURSOR_MOVED], 0, view->cursor_page, 
view->cursor_offset);
                        clear_selection (view);
                        return TRUE;


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