From ab7bc083aa41ce8a3fc830dace5ab24f650789f6 Mon Sep 17 00:00:00 2001 From: scuri Date: Mon, 28 Dec 2009 20:15:59 +0000 Subject: *** empty log message *** --- src/win32/cdwin.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/win32/cdwin.c') diff --git a/src/win32/cdwin.c b/src/win32/cdwin.c index 3b04497..4b38187 100644 --- a/src/win32/cdwin.c +++ b/src/win32/cdwin.c @@ -575,6 +575,12 @@ static void cdstipple(cdCtxCanvas* ctxcanvas, int w, int h, const unsigned char DeleteObject(hBitmap); } +static void set_dib_res(cdwDIB* dib, cdCtxCanvas* ctxcanvas) +{ + dib->bmih->biXPelsPerMeter = (LONG)(ctxcanvas->canvas->xres*1000); + dib->bmih->biYPelsPerMeter = (LONG)(ctxcanvas->canvas->yres*1000); +} + static void cdpattern(cdCtxCanvas* ctxcanvas, int w, int h, const long int *colors) { cdwDIB dib; @@ -589,6 +595,9 @@ static void cdpattern(cdCtxCanvas* ctxcanvas, int w, int h, const long int *colo if (!cdwCreateDIB(&dib)) return; + /* important to preserve pattern size during printing */ + set_dib_res(&dib, ctxcanvas); + cdwDIBEncodePattern(&dib, colors); hBrush = CreateDIBPatternBrushPt(dib.dib, DIB_RGB_COLORS); cdwKillDIB(&dib); -- cgit v1.2.3