summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garcia Campos <[email protected]>2013-07-20 11:05:12 +0200
committerraveit65 <[email protected]>2017-09-06 18:25:34 +0200
commitb5e5aeb90924938c65c8cb09b7d6f1aa0192dc12 (patch)
treee7823ef29e74a52768e332f877a65ddb036fcd4b
parent518e7e86554b74e9562e1c7801fc5ca42bdf45c2 (diff)
downloadatril-b5e5aeb90924938c65c8cb09b7d6f1aa0192dc12.tar.bz2
atril-b5e5aeb90924938c65c8cb09b7d6f1aa0192dc12.tar.xz
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
-rw-r--r--libview/ev-view.c8
1 files changed, 8 insertions, 0 deletions
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;