summaryrefslogtreecommitdiff
path: root/libview/ev-view.c
diff options
context:
space:
mode:
authornanxiongchao <[email protected]>2017-02-20 16:33:22 +0800
committernanxiongchao <[email protected]>2017-02-20 16:33:22 +0800
commit00fad2c0d0fcdade570a08f046e85a4558f1fc0c (patch)
tree364b764903a6103a9468d4355a371d7939f693bf /libview/ev-view.c
parent4b264c661a53e847b958cf6c8913c88a8cc707d5 (diff)
downloadatril-00fad2c0d0fcdade570a08f046e85a4558f1fc0c.tar.bz2
atril-00fad2c0d0fcdade570a08f046e85a4558f1fc0c.tar.xz
First page should not reloaded
For the displayed page, do not reload every time, should be displayed immediately Tested successfully on Loongson 3A2000 with fedora25(mips64el distribution).
Diffstat (limited to 'libview/ev-view.c')
-rw-r--r--libview/ev-view.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libview/ev-view.c b/libview/ev-view.c
index af0c3433..b360b22d 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -732,12 +732,13 @@ view_update_range_and_current_page (EvView *view)
}
}
+ #define PAGE_CACHE_NUMBER 10
ev_page_cache_set_page_range (view->page_cache,
- view->start_page,
- view->end_page);
+ MAX(view->start_page - PAGE_CACHE_NUMBER, 0),
+ MIN(view->end_page + PAGE_CACHE_NUMBER, ev_document_get_n_pages (view->document) - 1));
ev_pixbuf_cache_set_page_range (view->pixbuf_cache,
- view->start_page,
- view->end_page,
+ MAX(view->start_page - PAGE_CACHE_NUMBER, 0),
+ MIN(view->end_page + PAGE_CACHE_NUMBER, ev_document_get_n_pages (view->document) - 1),
view->selection_info.selections);
if (ev_pixbuf_cache_get_surface (view->pixbuf_cache, view->current_page))