diff options
author | hobbs <hobbs@noemail.net> | 2003-11-11 00:26:33 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2003-11-11 00:26:33 (GMT) |
commit | ab638a7e678fb6e8c2016f8c52de57ebc2d6a4fa (patch) | |
tree | cdcb50a2e9ee9f644304c2374d38c5ddce30be5a /win/tkWinDraw.c | |
parent | a50db523f2dbaf00805b3263aed7e43b88eb80c4 (diff) | |
download | tk-ab638a7e678fb6e8c2016f8c52de57ebc2d6a4fa.zip tk-ab638a7e678fb6e8c2016f8c52de57ebc2d6a4fa.tar.gz tk-ab638a7e678fb6e8c2016f8c52de57ebc2d6a4fa.tar.bz2 |
* win/tkWinDraw.c (XFillRectangles): correctly handle the
XGCValues.function parameter when filling rectangles.
[Bug #820278] [Patch #820282]
FossilOrigin-Name: 6bc71292aad1a5c7bf671fe5041d3d0c3cd3a387
Diffstat (limited to 'win/tkWinDraw.c')
-rw-r--r-- | win/tkWinDraw.c | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index 39a3d9c..21f0636 100644 --- a/win/tkWinDraw.c +++ b/win/tkWinDraw.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinDraw.c,v 1.12 2003/02/26 02:47:04 hobbs Exp $ + * RCS: @(#) $Id: tkWinDraw.c,v 1.12.2.1 2003/11/11 00:26:33 hobbs Exp $ */ #include "tkWinInt.h" @@ -630,7 +630,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) int i; RECT rect; TkWinDCState state; - HBRUSH brush; + HBRUSH brush, oldBrush; if (d == None) { return; @@ -644,7 +644,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) || gc->fill_style == FillOpaqueStippled) && gc->stipple != None) { TkWinDrawable *twdPtr = (TkWinDrawable *)gc->stipple; - HBRUSH oldBrush, stipple; + HBRUSH stipple; HBITMAP oldBitmap, bitmap; HDC dcMem; HBRUSH bgBrush = CreateSolidBrush(gc->background); @@ -694,9 +694,28 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) DeleteObject(stipple); DeleteObject(bgBrush); } else { - for (i = 0; i < nrectangles; i++) { - TkWinFillRect(dc, rectangles[i].x, rectangles[i].y, - rectangles[i].width, rectangles[i].height, gc->foreground); + if (gc->function == GXcopy) { + for (i = 0; i < nrectangles; i++) { + rect.left = rectangles[i].x; + rect.right = rect.left + rectangles[i].width; + rect.top = rectangles[i].y; + rect.bottom = rect.top + rectangles[i].height; + FillRect(dc, &rect, brush); + } + } else { + HPEN newPen = CreatePen(PS_NULL, 0, gc->foreground); + HPEN oldPen = SelectObject(dc, newPen); + oldBrush = SelectObject(dc, brush); + + for (i = 0; i < nrectangles; i++) { + Rectangle(dc, rectangles[i].x, rectangles[i].y, + rectangles[i].x + rectangles[i].width + 1, + rectangles[i].y + rectangles[i].height + 1); + } + + SelectObject(dc, oldBrush); + SelectObject(dc, oldPen); + DeleteObject(newPen); } } DeleteObject(brush); |