changeset 54126:8d0f80667054

(w32_draw_fringe_bitmap): Draw overlaid bitmaps correctly over other bitmaps.
author Jason Rumney <jasonr@gnu.org>
date Sun, 22 Feb 2004 22:41:52 +0000
parents 2ed4b33f8301
children 35aa728a0635
files src/w32term.c
diffstat 1 files changed, 29 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32term.c	Sun Feb 22 21:18:10 2004 +0000
+++ b/src/w32term.c	Sun Feb 22 22:41:52 2004 +0000
@@ -715,29 +715,41 @@
       SaveDC (hdc);
 
       horig_obj = SelectObject (compat_hdc, pixmap);
-      SetTextColor (hdc, face->background);
-      SetBkColor (hdc, p->cursor_p
-		        ? (p->overlay_p ? face->background
-			   : f->output_data.w32->cursor_pixel)
-			   : face->foreground);
 
       /* Paint overlays transparently.  */
       if (p->overlay_p)
 	{
-	BitBlt (hdc, p->x, p->y, p->wd, p->h,
-		compat_hdc, 0, p->dh,
-		DSTINVERT);
-	BitBlt (hdc, p->x, p->y, p->wd, p->h,
-		compat_hdc, 0, p->dh,
-		MERGEPAINT);
-	BitBlt (hdc, p->x, p->y, p->wd, p->h,
-		compat_hdc, 0, p->dh,
-		DSTINVERT);
+	  HBRUSH h_brush, h_orig_brush;
+
+	  SetTextColor (hdc, BLACK_PIX_DEFAULT (f));
+	  SetBkColor (hdc, WHITE_PIX_DEFAULT (f));
+	  h_brush = CreateSolidBrush (face->foreground);
+	  h_orig_brush = SelectObject (hdc, h_brush);
+
+	  BitBlt (hdc, p->x, p->y, p->wd, p->h,
+		  compat_hdc, 0, p->dh,
+		  DSTINVERT);
+	  BitBlt (hdc, p->x, p->y, p->wd, p->h,
+		  compat_hdc, 0, p->dh,
+		  0x2E064A);
+	  BitBlt (hdc, p->x, p->y, p->wd, p->h,
+		  compat_hdc, 0, p->dh,
+		  DSTINVERT);
+
+	  SelectObject (hdc, h_orig_brush);
+	  DeleteObject (h_brush);
 	}
       else
-	BitBlt (hdc, p->x, p->y, p->wd, p->h,
-		compat_hdc, 0, p->dh,
-		SRCCOPY);
+	{
+	  SetTextColor (hdc, face->background);
+	  SetBkColor (hdc, (p->cursor_p
+			    ? f->output_data.w32->cursor_pixel
+			    : face->foreground));
+
+	  BitBlt (hdc, p->x, p->y, p->wd, p->h,
+		  compat_hdc, 0, p->dh,
+		  SRCCOPY);
+	}
 
       SelectObject (compat_hdc, horig_obj);
       DeleteDC (compat_hdc);