diff options
| author | Jason Rumney | 2007-12-01 00:31:23 +0000 |
|---|---|---|
| committer | Jason Rumney | 2007-12-01 00:31:23 +0000 |
| commit | fb3b8017ffbc5906c06f8cb164285e35faa19dcf (patch) | |
| tree | 9f979c3ec0a64c52214a89cba656777a8528a640 /src | |
| parent | b9217c57e7296a7cafcd6997f69153e7c9f383da (diff) | |
| download | emacs-fb3b8017ffbc5906c06f8cb164285e35faa19dcf.tar.gz emacs-fb3b8017ffbc5906c06f8cb164285e35faa19dcf.zip | |
(w32font_draw): Fill background manually.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32font.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/w32font.c b/src/w32font.c index e8e9b4ce2f8..33b97dc5889 100644 --- a/src/w32font.c +++ b/src/w32font.c | |||
| @@ -531,25 +531,23 @@ w32font_draw (s, from, to, x, y, with_background) | |||
| 531 | DeleteObject (new_clip); | 531 | DeleteObject (new_clip); |
| 532 | } | 532 | } |
| 533 | 533 | ||
| 534 | /* Using OPAQUE background mode can clear more background than expected | ||
| 535 | when Cleartype is used. Draw the background manually to avoid this. */ | ||
| 536 | SetBkMode (s->hdc, TRANSPARENT); | ||
| 534 | if (with_background) | 537 | if (with_background) |
| 535 | { | 538 | { |
| 536 | SetBkColor (s->hdc, s->gc->background); | ||
| 537 | SetBkMode (s->hdc, OPAQUE); | ||
| 538 | #if 0 | ||
| 539 | HBRUSH brush; | 539 | HBRUSH brush; |
| 540 | RECT rect; | 540 | RECT rect; |
| 541 | struct font *font = (struct font *) s->face->font_info; | ||
| 541 | 542 | ||
| 542 | brush = CreateSolidBrush (s->gc->background); | 543 | brush = CreateSolidBrush (s->gc->background); |
| 543 | rect.left = x; | 544 | rect.left = x; |
| 544 | rect.top = y - ((struct font *) (s->font_info->font))->ascent; | 545 | rect.top = y - font->ascent; |
| 545 | rect.right = x + s->width; | 546 | rect.right = x + s->width; |
| 546 | rect.bottom = y + ((struct font *) (s->font_info->font))->descent; | 547 | rect.bottom = y + font->descent; |
| 547 | FillRect (s->hdc, &rect, brush); | 548 | FillRect (s->hdc, &rect, brush); |
| 548 | DeleteObject (brush); | 549 | DeleteObject (brush); |
| 549 | #endif | ||
| 550 | } | 550 | } |
| 551 | else | ||
| 552 | SetBkMode (s->hdc, TRANSPARENT); | ||
| 553 | 551 | ||
| 554 | ExtTextOutW (s->hdc, x, y, options, NULL, s->char2b + from, to - from, NULL); | 552 | ExtTextOutW (s->hdc, x, y, options, NULL, s->char2b + from, to - from, NULL); |
| 555 | 553 | ||