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



commit 5a9b14eb60874c7177bb18e671f72eaef66cef02
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 `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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 7a071075..98843a97 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -6446,11 +6446,13 @@ ev_view_move_cursor (EvView         *view,
                } else if (prev_page > view->cursor_page) {
                        ev_view_previous_page (view);
                        cursor_go_to_page_end (view);
-                       ensure_rectangle_is_visible (view, &rect);
                        changed_page = TRUE;
                }
 
                if (changed_page) {
+                       rect.x += view->scroll_x;
+                       rect.y += view->scroll_y;
+                       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]