diff options
author | Mark McLoughlin <mark@skynet.ie> | 2004-12-22 12:59:02 (GMT) |
---|---|---|
committer | Mark McLoughlin <markmc@src.gnome.org> | 2004-12-22 12:59:02 (GMT) |
commit | c2822868b202e30f2bcf8d4141824594f6be0d99 (patch) | |
tree | 77d81bc394d12e42a0f4fd944c7a9639cf65f145 | |
parent | 7f32f6e5c1cd8f8868f6b0a26dde7259e79e5411 (diff) |
because get_page_size() returns the scaled page size, we need to calculate
2004-12-22 Mark McLoughlin <mark@skynet.ie>
* shell/ev-view.c:
(ev_view_best_fit), (ev_view_fit_width): because
get_page_size() returns the scaled page size, we
need to calculate the scale factor relative to
the previous scale factor. Should really just
add get_real_page_size().
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | shell/ev-view.c | 6 |
2 files changed, 12 insertions, 3 deletions
@@ -1,5 +1,14 @@ 2004-12-22 Mark McLoughlin <mark@skynet.ie> + * shell/ev-view.c: + (ev_view_best_fit), (ev_view_fit_width): because + get_page_size() returns the scaled page size, we + need to calculate the scale factor relative to + the previous scale factor. Should really just + add get_real_page_size(). + +2004-12-22 Mark McLoughlin <mark@skynet.ie> + * shell/ev-view.[ch]: (ev_view_zoom), (ev_view_zoom_in), (ev_view_zoom_out), (ev_view_normal_size), (ev_view_best_fit), (ev_view_fit_width): diff --git a/shell/ev-view.c b/shell/ev-view.c index 78a75d9..dd8723d 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -613,8 +613,8 @@ ev_view_best_fit (EvView *view) if (width != 0 && height != 0) { double scale_w, scale_h; - scale_w = (double)GTK_WIDGET (view)->allocation.width / width; - scale_h = (double)GTK_WIDGET (view)->allocation.height / height; + scale_w = (double)GTK_WIDGET (view)->allocation.width * view->scale / width; + scale_h = (double)GTK_WIDGET (view)->allocation.height * view->scale / height; scale = (scale_w < scale_h) ? scale_w : scale_h; } @@ -633,7 +633,7 @@ ev_view_fit_width (EvView *view) scale = 1.0; if (width != 0) - scale = (double)GTK_WIDGET (view)->allocation.width / width; + scale = (double)GTK_WIDGET (view)->allocation.width * view->scale / width; ev_view_zoom (view, scale, FALSE); } |