summaryrefslogtreecommitdiff
path: root/src/win32/cdwin.c
diff options
context:
space:
mode:
authorscuri <scuri>2009-12-28 20:15:59 +0000
committerscuri <scuri>2009-12-28 20:15:59 +0000
commitab7bc083aa41ce8a3fc830dace5ab24f650789f6 (patch)
treea1fe4c8e73764574523a76db6a927e2723631f3a /src/win32/cdwin.c
parent0eac3837284945aecb6af07e58d71725382a26d6 (diff)
*** empty log message ***
Diffstat (limited to 'src/win32/cdwin.c')
-rw-r--r--src/win32/cdwin.c9
1 files changed, 9 insertions, 0 deletions
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);