]> www.fi.muni.cz Git - evince.git/blobdiff - ps/ps-document.c
Updated German translation.
[evince.git] / ps / ps-document.c
index 6723edb6312f3f35c73d39cd7006ccb17e43697b..fd6fc4a62d5785fcf250a806cda5b5e441f465d8 100644 (file)
@@ -272,6 +272,9 @@ ps_document_init(PSDocument * gs)
   gs->right_margin = 0;
   gs->bottom_margin = 0;
 
+  gs->page_x_offset = 0;
+  gs->page_y_offset = 0;
+
   /* Set user defined defaults */
   gs->override_orientation = gtk_gs_defaults_get_override_orientation();
   gs->fallback_orientation = gtk_gs_defaults_get_orientation();
@@ -1773,13 +1776,20 @@ ps_document_set_page_offset (EvDocument  *document,
                              int          x,
                              int          y)
 {
+       PSDocument *gs = PS_DOCUMENT (document);
+
+       gs->page_x_offset = x;
+       gs->page_y_offset = y;
 }
 
 static void
 ps_document_get_page_size (EvDocument   *document,
-                           int          *width,
-                           int          *height)
+                          int           page,
+                          int          *width,
+                          int          *height)
 {
+       /* Post script documents never vary in size */
+
        PSDocument *gs = PS_DOCUMENT (document);
 
        if (width) {
@@ -1799,6 +1809,8 @@ ps_document_render (EvDocument  *document,
                    int          clip_height)
 {
        PSDocument *gs = PS_DOCUMENT (document);
+       GdkRectangle page;
+       GdkRectangle draw;
        GdkGC *gc;
 
        if (gs->pstarget == NULL ||
@@ -1806,13 +1818,23 @@ ps_document_render (EvDocument  *document,
                return;
        }
 
+       page.x = gs->page_x_offset;
+       page.y = gs->page_y_offset;
+       page.width = gs->width;
+       page.height = gs->height;
+
+       draw.x = clip_x;
+       draw.y = clip_y;
+       draw.width = clip_width;
+       draw.height = clip_height;
+
        gc = gdk_gc_new (gs->pstarget);
 
        gdk_draw_drawable (gs->pstarget, gc,
                           gs->bpixmap,
-                          clip_x, clip_y,
-                          clip_x, clip_y,
-                          clip_width, clip_height);
+                          draw.x - page.x, draw.y - page.y,
+                          draw.x, draw.y,
+                          draw.width, draw.height);
 
        g_object_unref (gc);
 }