]> www.fi.muni.cz Git - evince.git/commitdiff
forgot this
authorMarco Pesenti Gritti <marco@src.gnome.org>
Thu, 20 Jan 2005 18:05:47 +0000 (18:05 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Thu, 20 Jan 2005 18:05:47 +0000 (18:05 +0000)
shell/ev-view.c

index e76f5b81728af22109298bb499683c81d825e767..cd3d666a4c3b5f684e47460e16ba1ee20ddd1a5d 100644 (file)
@@ -395,13 +395,19 @@ expose_bin_window (GtkWidget      *widget,
                   GdkEventExpose *event)
 {
        EvView *view = EV_VIEW (widget);
-        int i;
-       int current_page;
+        int i, current_page;
+       int x_offset, y_offset;
         const EvFindResult *results;
 
        if (view->document == NULL)
                return;
-       
+
+       x_offset = MAX (0, (widget->allocation.width -
+                           widget->requisition.width) / 2);
+       y_offset = MAX (0, (widget->allocation.height -
+                           widget->requisition.height) / 2);
+       ev_document_set_page_offset (view->document, x_offset, y_offset);
+
        ev_document_render (view->document,
                            event->area.x, event->area.y,
                            event->area.width, event->area.height);