summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2008-01-02 14:02:12 +0100
committerCarlos Garcia Campos <carlosgc@gnome.org>2008-01-02 14:02:12 +0100
commit7ef5479d0ff3783d3b416a3e70f69a853e0fa6d5 (patch)
tree6b99662d7986ff415ae3931b0e6d06eebc0aa7fa
parent0bdbc8287aa4fb397babd47f0744d077c271f986 (diff)
Do not add x, y offset twice in multi-page documents
Fixes tile rendering in documents like tiger.ps
-rw-r--r--libspectre/spectre-gs.c12
-rw-r--r--test/spectre-test.c1
2 files changed, 10 insertions, 3 deletions
diff --git a/libspectre/spectre-gs.c b/libspectre/spectre-gs.c
index 249e0e5..14bb48d 100644
--- a/libspectre/spectre-gs.c
+++ b/libspectre/spectre-gs.c
@@ -231,9 +231,17 @@ spectre_gs_send_page (SpectreGS *gs,
}
}
+ if (doc->numpages > 0) {
+ page_llx += x;
+ page_lly += y;
+ } else {
+ doc_llx += x;
+ doc_lly += y;
+ }
+
if (!spectre_gs_process (gs,
doc->filename,
- doc_llx + x, doc_lly + y,
+ doc_llx, doc_lly,
doc->beginprolog,
doc->endprolog))
return FALSE;
@@ -248,7 +256,7 @@ spectre_gs_send_page (SpectreGS *gs,
if (doc->numpages > 0) {
if (!spectre_gs_process (gs,
doc->filename,
- page_llx + x, page_lly + y,
+ page_llx, page_lly,
doc->pages[page_index].begin,
doc->pages[page_index].end))
return FALSE;
diff --git a/test/spectre-test.c b/test/spectre-test.c
index 8c72af1..ad8c5c2 100644
--- a/test/spectre-test.c
+++ b/test/spectre-test.c
@@ -221,7 +221,6 @@ test_document_render (SpectreDocument *document,
cairo_surface_t *surface;
char *filename;
- /* TODO: wat to do with width, height */
surface = cairo_image_surface_create_for_data (data,
CAIRO_FORMAT_RGB24,
width, height,