int page,
EvRectangle *doc_rect,
GdkRectangle *view_rect);
+static gboolean get_dual_even_left (EvView *view);
static void find_page_at_location (EvView *view,
gdouble x,
gdouble y,
}
} else if (view->dual_page) {
- if (view->current_page % 2 == ev_page_cache_get_dual_even_left (view->page_cache)) {
+ if (view->current_page % 2 == get_dual_even_left (view)) {
view->start_page = view->current_page;
if (view->current_page + 1 < ev_document_get_n_pages (view->document))
view->end_page = view->start_page + 1;
if (view->dual_page) {
ev_view_get_height_to_page (view, page, NULL, &offset);
- offset += ((page + ev_page_cache_get_dual_even_left (view->page_cache)) / 2 + 1) * view->spacing + ((page + ev_page_cache_get_dual_even_left (view->page_cache)) / 2 ) * (border.top + border.bottom);
+ offset += ((page + get_dual_even_left (view)) / 2 + 1) * view->spacing +
+ ((page + get_dual_even_left (view)) / 2 ) * (border.top + border.bottom);
} else {
ev_view_get_height_to_page (view, page, &offset, NULL);
offset += (page + 1) * view->spacing + page * (border.top + border.bottom);
max_width = max_width + border->left + border->right;
/* Get the location of the bounding box */
if (view->dual_page) {
- x = view->spacing + ((page % 2 == ev_page_cache_get_dual_even_left (view->page_cache)) ? 0 : 1) * (max_width + view->spacing);
+ x = view->spacing + ((page % 2 == get_dual_even_left (view)) ? 0 : 1) * (max_width + view->spacing);
x = x + MAX (0, widget->allocation.width - (max_width * 2 + view->spacing * 3)) / 2;
- if (page % 2 == ev_page_cache_get_dual_even_left (view->page_cache))
+ if (page % 2 == get_dual_even_left (view))
x = x + (max_width - width - border->left - border->right);
} else {
x = view->spacing;
GtkBorder overall_border;
gint other_page;
- other_page = (page % 2 == ev_page_cache_get_dual_even_left (view->page_cache)) ? page + 1: page - 1;
+ other_page = (page % 2 == get_dual_even_left (view)) ? page + 1: page - 1;
/* First, we get the bounding box of the two pages */
if (other_page < ev_document_get_n_pages (view->document)
y = view->spacing;
/* Adjust for being the left or right page */
- if (page % 2 == ev_page_cache_get_dual_even_left (view->page_cache))
+ if (page % 2 == get_dual_even_left (view))
x = x + max_width - width;
else
x = x + (max_width + overall_border.left + overall_border.right) + view->spacing;
view_rect->height = h * view->scale;
}
+static gboolean
+get_dual_even_left (EvView *view)
+{
+ return (ev_document_get_n_pages (view->document) > 2);
+}
+
static void
find_page_at_location (EvView *view,
gdouble x,