]> www.fi.muni.cz Git - evince.git/commitdiff
make page size calculation consistent and set it to (int)( width * scale +
authorJonathan Blandford <jrb@redhat.com>
Wed, 11 May 2005 05:20:51 +0000 (05:20 +0000)
committerJonathan Blandford <jrb@src.gnome.org>
Wed, 11 May 2005 05:20:51 +0000 (05:20 +0000)
Wed May 11 01:18:29 2005  Jonathan Blandford  <jrb@redhat.com>

        * pdf/ev-poppler.cc:
        * backend/ev-page-cache.c: make page size calculation consistent
        and set it to (int)( width * scale + 0.5).  This makes the weird
        line going through the middle of the page go away.

        * shell/ev-view.c: move painting the background page after
        checking the expose area covers us.

ChangeLog
backend/ev-page-cache.c
pdf/ev-poppler.cc
shell/ev-view.c

index d40a013bd02d3379128043424d177be555701e75..60e03110b01b719bd3788ca5516e77505a63482c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Wed May 11 01:18:29 2005  Jonathan Blandford  <jrb@redhat.com>
+
+       * pdf/ev-poppler.cc:
+       * backend/ev-page-cache.c: make page size calculation consistent
+       and set it to (int)( width * scale + 0.5).  This makes the weird
+       line going through the middle of the page go away.
+
+       * shell/ev-view.c: move painting the background page after
+       checking the expose area covers us.
+
 2005-05-11  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
        * data/evince-password.glade:
index c66a1a42d9ec7444b37109c8f51a249ada2c8a95..6302c42e03b973fcc8b79bdd8cdaf62d3b6d1346 100644 (file)
@@ -308,9 +308,9 @@ ev_page_cache_get_size (EvPageCache *page_cache,
        }
 
        if (width)
-               *width = (*width) * scale;
+               *width = (int) ((*width) * scale + 0.5);
        if (width)
-               *height = (*height) * scale;
+               *height = (int) ((*height) * scale + 0.5);
 
 }
 
index 7b55b08cbdbc2ec286351c20349c15741ff6d3fa..32613558dcdd55a7d00e2c73153e347739f03b72 100644 (file)
@@ -254,8 +254,8 @@ pdf_document_render_pixbuf (EvDocument   *document,
                                                  page);
 
        poppler_page_get_size (poppler_page, &width_points, &height_points);
-       width = (int) ceil (width_points * scale);
-       height = (int) ceil (height_points * scale);
+       width = (int) ((width_points * scale) + 0.5);
+       height = (int) ((height_points * scale) + 0.5);
 
        pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
                                 FALSE, 8,
index 6dfe1815a7a4c6c5ffa39edfaf3fe6c7acaa6592..cf60e36b9e0b7969d42076e4c3244e5f74142577 100644 (file)
@@ -940,10 +940,6 @@ draw_one_page (EvView       *view,
                                page, view->scale,
                                &width, &height);
 
-       ev_document_misc_paint_one_page (view->bin_window,
-                                        GTK_WIDGET (view),
-                                        page_area, border);
-
        /* Render the document itself */
        real_page_area = *page_area;
 
@@ -955,7 +951,12 @@ draw_one_page (EvView       *view,
        if (! gdk_rectangle_intersect (&real_page_area, expose_area, &overlap))
                return;
 
+       ev_document_misc_paint_one_page (view->bin_window,
+                                        GTK_WIDGET (view),
+                                        page_area, border);
+
        current_pixbuf = ev_pixbuf_cache_get_pixbuf (view->pixbuf_cache, page);
+
        if (current_pixbuf == NULL)
                scaled_image = NULL;
        else if (width == gdk_pixbuf_get_width (current_pixbuf) &&
@@ -965,6 +966,7 @@ draw_one_page (EvView       *view,
                scaled_image = gdk_pixbuf_scale_simple (current_pixbuf,
                                                        width, height,
                                                        GDK_INTERP_NEAREST);
+
        if (scaled_image) {
                gdk_draw_pixbuf (view->bin_window,
                                 GTK_WIDGET (view)->style->fg_gc[GTK_STATE_NORMAL],