* 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"
2005-01-21 Martin Kretzschmar <martink@gnome.org>
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.
* data/evince.desktop.in (X-GNOME-Bugzilla-Product):
s/gpdf/evince/. Spotted by Stephane Loeuillet.
+ PSDocument *gs = PS_DOCUMENT (document);
+
+ gs->page_x_offset = x;
+ gs->page_y_offset = y;
int clip_height)
{
PSDocument *gs = PS_DOCUMENT (document);
int clip_height)
{
PSDocument *gs = PS_DOCUMENT (document);
+ GdkRectangle page;
+ GdkRectangle draw;
GdkGC *gc;
if (gs->pstarget == NULL ||
GdkGC *gc;
if (gs->pstarget == NULL ||
+ 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,
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);
const gchar *gs_status; /* PSDocument status */
guint avail_w, avail_h;
const gchar *gs_status; /* PSDocument status */
guint avail_w, avail_h;
+
+ int page_x_offset;
+ int page_y_offset;
};
struct _PSDocumentClass {
};
struct _PSDocumentClass {