]> www.fi.muni.cz Git - evince.git/commitdiff
(pixbuf_document_thumbnails_get_dimensions): force floating point
authorMartin Kretzschmar <martink@src.gnome.org>
Fri, 21 Jan 2005 00:58:12 +0000 (00:58 +0000)
committerMartin Kretzschmar <martink@src.gnome.org>
Fri, 21 Jan 2005 00:58:12 +0000 (00:58 +0000)
division to calculate page_ratio. Fixes crash with landscape format
pixbufs.

ChangeLog
pixbuf/pixbuf-document.c

index 1c2218fec7a3c348d4414596703bac402ae1f7a7..3c6dd89553ff579925ab332250f6e9de2ae030a0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-01-21  Martin Kretzschmar  <martink@gnome.org>
+
+       * pixbuf/pixbuf-document.c
+       (pixbuf_document_thumbnails_get_dimensions): force floating point
+       division to calculate page_ratio. Fixes crash with landscape
+       format pixbufs.
+
 Thu Jan 20 18:56:35 2005  Jonathan Blandford  <jrb@redhat.com>
 
        * shell/ev-view.c (ev_view_realize): make the bg color darker.
index cdf131009200b170309b440847675950769dea97..65cef92929b2d9a933d9c1964b06e178f2a042b1 100644 (file)
@@ -287,7 +287,7 @@ pixbuf_document_thumbnails_get_dimensions (EvDocumentThumbnails *document,
        PixbufDocument *pixbuf_document = PIXBUF_DOCUMENT (document);
        gdouble page_ratio;
 
-       page_ratio = gdk_pixbuf_get_height (pixbuf_document->pixbuf) /
+       page_ratio = ((double)gdk_pixbuf_get_height (pixbuf_document->pixbuf)) /
                     gdk_pixbuf_get_width (pixbuf_document->pixbuf);
        *width = suggested_width;
        *height = (gint) (suggested_width * page_ratio);