[gtk+/gtk-2-18] Take printer margins into account on Windows
- From: Tor Lillqvist <tml src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-18] Take printer margins into account on Windows
- Date: Tue, 27 Oct 2009 10:29:59 +0000 (UTC)
commit 9d43f0fff0c60dd0af3070f18397b3d8acc0928c
Author: Adrian Johnson <ajohnson redneon com>
Date: Mon Oct 26 11:09:16 2009 +0200
Take printer margins into account on Windows
Fixes bug #381371.
gtk/gtkprintoperation-win32.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkprintoperation-win32.c b/gtk/gtkprintoperation-win32.c
index 3da48cb..b7210f0 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]