diff options
author | Carlos Garcia Campos <[email protected]> | 2013-07-20 11:05:12 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-09-06 18:25:34 +0200 |
commit | b5e5aeb90924938c65c8cb09b7d6f1aa0192dc12 (patch) | |
tree | e7823ef29e74a52768e332f877a65ddb036fcd4b /libview/ev-view.c | |
parent | 518e7e86554b74e9562e1c7801fc5ca42bdf45c2 (diff) | |
download | atril-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
Diffstat (limited to 'libview/ev-view.c')
-rw-r--r-- | 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 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; |