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-01-03 19:32:11 (GMT)
committer Carlos Garcia Campos <carlosgc@gnome.org>2010-01-03 20:14:13 (GMT)
commite288b2cb68ac2645bfee992566bd8f1974388fb1 (patch)
tree6d2b701316769f66e259d1720adf462fce37758a /libview
parent1ffe54671c4d242e9698f1a07276552dfdabcd07 (diff)
[libview] Fix double to int conversion
Diffstat (limited to 'libview')
-rw-r--r--libview/ev-view-presentation.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/libview/ev-view-presentation.c b/libview/ev-view-presentation.c
index 8f91869..72af799 100644
--- a/libview/ev-view-presentation.c
+++ b/libview/ev-view-presentation.c
@@ -184,27 +184,25 @@ ev_view_presentation_get_page_area (EvViewPresentation *pview,
GdkRectangle *area)
{
GtkWidget *widget = GTK_WIDGET (pview);
- gdouble width, height;
+ gdouble doc_width, doc_height;
+ gint view_width, view_height;
ev_document_get_page_size (pview->document,
pview->current_page,
- &width, &height);
+ &doc_width, &doc_height);
if (pview->rotation == 90 || pview->rotation == 270) {
- gdouble tmp;
-
- tmp = width;
- width = height;
- height = tmp;
+ view_width = (gint)((doc_height * pview->scale) + 0.5);
+ view_height = (gint)((doc_width * pview->scale) + 0.5);
+ } else {
+ view_width = (gint)((doc_width * pview->scale) + 0.5);
+ view_height = (gint)((doc_height * pview->scale) + 0.5);
}
- width *= pview->scale;
- height *= pview->scale;
-
- area->x = (MAX (0, widget->allocation.width - width)) / 2;
- area->y = (MAX (0, widget->allocation.height - height)) / 2;
- area->width = width;
- area->height = height;
+ area->x = (MAX (0, widget->allocation.width - view_width)) / 2;
+ area->y = (MAX (0, widget->allocation.height - view_height)) / 2;
+ area->width = view_width;
+ area->height = view_height;
}
/* Page Transition */