]> www.fi.muni.cz Git - evince.git/commitdiff
because get_page_size() returns the scaled page size, we need to calculate
authorMark McLoughlin <mark@skynet.ie>
Wed, 22 Dec 2004 12:59:02 +0000 (12:59 +0000)
committerMark McLoughlin <markmc@src.gnome.org>
Wed, 22 Dec 2004 12:59:02 +0000 (12:59 +0000)
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().

ChangeLog
shell/ev-view.c

index 0c20524791dfb2155952264a5786bb246f497cc8..7c3a3f467bb0fe3cd79fe65686fa6ca9dcb32b52 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+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]:
index 78a75d99e8889d2df17bb6fa42d46031cc4a35cc..dd8723dc8e9fcbb3f99865ad0a67dc423cc1a96c 100644 (file)
@@ -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);
 }