Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Kretzschmar <martink@src.gnome.org>2005-01-21 13:29:36 (GMT)
committer Martin Kretzschmar <martink@src.gnome.org>2005-01-21 13:29:36 (GMT)
commit44eab3deb5f1a748d95bd250841cfd500085a48f (patch)
treea18adb5e691823675eedf9aff0136b06833abc6d
parentb0aeba08ccb8ced29a77d008042f62de1a57394b (diff)
add page_[xy]_offset fields.
* ps/ps-document.h: add page_[xy]_offset fields. * ps/ps-document.c (ps_document_set_page_offset) (ps_document_render): Keep offset in consideration in a few places. Bug #164752 "postscript documents are not centered in window"
-rw-r--r--ChangeLog7
-rw-r--r--ps/ps-document.c22
-rw-r--r--ps/ps-document.h3
3 files changed, 29 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 7c1eb15..b6f5f5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2005-01-21 Martin Kretzschmar <martink@gnome.org>
+ * ps/ps-document.h: add page_[xy]_offset fields.
+
+ * ps/ps-document.c (ps_document_set_page_offset)
+ (ps_document_render): Keep offset in consideration in a few
+ places. Bug #164752 "postscript documents are not centered in
+ window"
+
* data/evince.desktop.in (X-GNOME-Bugzilla-Product):
s/gpdf/evince/. Spotted by Stephane Loeuillet.
diff --git a/ps/ps-document.c b/ps/ps-document.c
index 6723edb..848d1a7 100644
--- a/ps/ps-document.c
+++ b/ps/ps-document.c
@@ -1773,6 +1773,10 @@ 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
@@ -1799,6 +1803,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 +1812,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);
}
diff --git a/ps/ps-document.h b/ps/ps-document.h
index dd5555e..fb58ca4 100644
--- a/ps/ps-document.h
+++ b/ps/ps-document.h
@@ -107,6 +107,9 @@ struct _PSDocument {
const gchar *gs_status; /* PSDocument status */
guint avail_w, avail_h;
+
+ int page_x_offset;
+ int page_y_offset;
};
struct _PSDocumentClass {