From b5e5aeb90924938c65c8cb09b7d6f1aa0192dc12 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Sat, 20 Jul 2013 11:05:12 +0200 Subject: 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. origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=4969e2b --- libview/ev-view.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libview') diff --git a/libview/ev-view.c b/libview/ev-view.c index 36286614..ea101dce 100644 --- a/libview/ev-view.c +++ b/libview/ev-view.c @@ -7580,6 +7580,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) @@ -7631,6 +7635,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; -- cgit v1.2.1