Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/libview
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2010-05-09 14:45:22 (GMT)
committer Carlos Garcia Campos <carlosgc@gnome.org>2010-05-10 11:58:38 (GMT)
commit6f9a44f48ab43e4a1efb46136cba8accb3487f92 (patch)
tree7dbe3edfd5b430aa5b8874505e10b96f781b063b /libview
parent6ab3c9184c95446e436bf6e71b9b8228644b1960 (diff)
[libview] Take into account scrollbar size to get zoom for best fit in contnuous mode
Diffstat (limited to 'libview')
-rw-r--r--libview/ev-view.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libview/ev-view.c b/libview/ev-view.c
index c766dd2..194361f 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -4887,6 +4887,7 @@ ev_view_zoom_for_size_continuous_and_dual_page (EvView *view,
gdouble doc_width, doc_height;
GtkBorder border;
gdouble scale;
+ gint sb_size;
ev_document_get_max_page_size (view->document, &doc_width, &doc_height);
if (view->rotation == 90 || view->rotation == 270) {
@@ -4903,13 +4904,12 @@ ev_view_zoom_for_size_continuous_and_dual_page (EvView *view,
width -= (2 * (border.left + border.right) + 3 * view->spacing);
height -= (border.top + border.bottom + 2 * view->spacing - 1);
- if (view->sizing_mode == EV_SIZING_FIT_WIDTH) {
- gint sb_size;
+ sb_size = ev_view_get_scrollbar_size (view, GTK_ORIENTATION_VERTICAL);
- sb_size = ev_view_get_scrollbar_size (view, GTK_ORIENTATION_VERTICAL);
+ if (view->sizing_mode == EV_SIZING_FIT_WIDTH) {
scale = zoom_for_size_fit_width (doc_width, doc_height, width - sb_size, height);
} else if (view->sizing_mode == EV_SIZING_BEST_FIT)
- scale = zoom_for_size_best_fit (doc_width, doc_height, width, height);
+ scale = zoom_for_size_best_fit (doc_width, doc_height, width - sb_size, height);
else
g_assert_not_reached ();
@@ -4924,6 +4924,7 @@ ev_view_zoom_for_size_continuous (EvView *view,
gdouble doc_width, doc_height;
GtkBorder border;
gdouble scale;
+ gint sb_size;
ev_document_get_max_page_size (view->document, &doc_width, &doc_height);
if (view->rotation == 90 || view->rotation == 270) {
@@ -4939,13 +4940,12 @@ ev_view_zoom_for_size_continuous (EvView *view,
width -= (border.left + border.right + 2 * view->spacing);
height -= (border.top + border.bottom + 2 * view->spacing - 1);
- if (view->sizing_mode == EV_SIZING_FIT_WIDTH) {
- gint sb_size;
+ sb_size = ev_view_get_scrollbar_size (view, GTK_ORIENTATION_VERTICAL);
- sb_size = ev_view_get_scrollbar_size (view, GTK_ORIENTATION_VERTICAL);
+ if (view->sizing_mode == EV_SIZING_FIT_WIDTH) {
scale = zoom_for_size_fit_width (doc_width, doc_height, width - sb_size, height);
} else if (view->sizing_mode == EV_SIZING_BEST_FIT)
- scale = zoom_for_size_best_fit (doc_width, doc_height, width, height);
+ scale = zoom_for_size_best_fit (doc_width, doc_height, width - sb_size, height);
else
g_assert_not_reached ();