summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2009-10-26 11:09:16 +0200
committerTor Lillqvist <tml@iki.fi>2009-10-27 12:29:37 +0200
commit9d43f0fff0c60dd0af3070f18397b3d8acc0928c (patch)
tree7caeb134a1c0b5d50e965bf7cd5673754caeab82
parenta21ab9d1694ee04935389a52e2d737eeaf9cf2d3 (diff)
downloadgdk-pixbuf-9d43f0fff0c60dd0af3070f18397b3d8acc0928c.tar.gz
Take printer margins into account on Windows
Fixes bug #381371.
-rw-r--r--gtk/gtkprintoperation-win32.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/gtkprintoperation-win32.c b/gtk/gtkprintoperation-win32.c
index 3da48cb70..b7210f0d8 100644
--- a/gtk/gtkprintoperation-win32.c
+++ b/gtk/gtkprintoperation-win32.c
@@ -444,6 +444,7 @@ win32_start_page (GtkPrintOperation *op,
GtkPrintOperationWin32 *op_win32 = op->priv->platform_data;
LPDEVMODEW devmode;
GtkPaperSize *paper_size;
+ double x_off, y_off;
devmode = GlobalLock (op_win32->devmode);
@@ -468,6 +469,10 @@ win32_start_page (GtkPrintOperation *op,
ResetDCW (op_win32->hdc, devmode);
GlobalUnlock (op_win32->devmode);
+
+ x_off = GetDeviceCaps (op_win32->hdc, PHYSICALOFFSETX);
+ y_off = GetDeviceCaps (op_win32->hdc, PHYSICALOFFSETY);
+ cairo_surface_set_device_offset (op_win32->surface, -x_off, -y_off);
StartPage (op_win32->hdc);
}