[evince] libview: Fix selections starting/ending in page margins



commit 4969e2b29d32f8177988a4bf4f62d7704f39f5e1
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Sat Jul 20 11:05:12 2013 +0200

    libview: Fix selections starting/ending in page margins
    
    Do not take into account the page area borders when looking the pages
    where the selection starts or ends. This allows to start a new selection
    from a page margin and prevents selection from disappearing when
    selecting multiple pages and releasing the mouse between two pages.

 libview/ev-view.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 4f51f66..c51f236 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -7460,6 +7460,10 @@ get_selection_page_range (EvView          *view,
                GtkBorder    border;
 
                ev_view_get_page_extents (view, i, &page_area, &border);
+               page_area.x -= border.left;
+               page_area.y -= border.top;
+               page_area.width += border.left + border.right;
+               page_area.height += border.top + border.bottom;
                if (gdk_rectangle_point_in (&page_area, start) ||
                    gdk_rectangle_point_in (&page_area, stop)) {
                        if (first == -1)
@@ -7511,6 +7515,10 @@ compute_new_selection (EvView          *view,
                selection->rect.y2 = height;
 
                ev_view_get_page_extents (view, i, &page_area, &border);
+               page_area.x -= border.left;
+               page_area.y -= border.top;
+               page_area.width += border.left + border.right;
+               page_area.height += border.top + border.bottom;
 
                if (gdk_rectangle_point_in (&page_area, start))
                        point = start;


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