diff options
| author | Jan Djärv | 2010-12-03 11:54:44 +0100 |
|---|---|---|
| committer | Jan Djärv | 2010-12-03 11:54:44 +0100 |
| commit | 146490c35d54bb78d24082c33e04ddcb518ef015 (patch) | |
| tree | d77a7637b00cd6fd00519b0aef5a6948cbb8553f /src | |
| parent | babc8f0d4a6b1fc24b1fe3fc10a833eb3e694906 (diff) | |
| download | emacs-146490c35d54bb78d24082c33e04ddcb518ef015.tar.gz emacs-146490c35d54bb78d24082c33e04ddcb518ef015.zip | |
Draw cursor and images correctly for Nextstep (bug#7412).
* src/nsterm.m (ns_dumpglyphs_image): If drawing cursor, fill background
with cursor color and draw a rectangle around the image.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/nsterm.m | 15 |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ccc3e480eb9..6213a2d4687 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-12-03 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * nsterm.m (ns_dumpglyphs_image): If drawing cursor, fill background | ||
| 4 | with cursor color and draw a rectangle around the image (Bug#7412). | ||
| 5 | |||
| 1 | 2010-12-03 Andreas Schwab <schwab@linux-m68k.org> | 6 | 2010-12-03 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 7 | ||
| 3 | * frame.c (x_set_font): Remove unused variable. | 8 | * frame.c (x_set_font): Remove unused variable. |
diff --git a/src/nsterm.m b/src/nsterm.m index 128c9de86a0..78d690c020d 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -2779,7 +2779,10 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r) | |||
| 2779 | else | 2779 | else |
| 2780 | face = FACE_FROM_ID (s->f, s->first_glyph->face_id); | 2780 | face = FACE_FROM_ID (s->f, s->first_glyph->face_id); |
| 2781 | 2781 | ||
| 2782 | [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f) set]; | 2782 | if (s->hl == DRAW_CURSOR) |
| 2783 | [FRAME_CURSOR_COLOR (s->f) set]; | ||
| 2784 | else | ||
| 2785 | [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f) set]; | ||
| 2783 | 2786 | ||
| 2784 | if (bg_height > s->slice.height || s->img->hmargin || s->img->vmargin | 2787 | if (bg_height > s->slice.height || s->img->hmargin || s->img->vmargin |
| 2785 | || s->img->mask || s->img->pixmap == 0 || s->width != s->background_width) | 2788 | || s->img->mask || s->img->pixmap == 0 || s->width != s->background_width) |
| @@ -2842,6 +2845,16 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r) | |||
| 2842 | s->slice.x == 0, | 2845 | s->slice.x == 0, |
| 2843 | s->slice.x + s->slice.width == s->img->width, s); | 2846 | s->slice.x + s->slice.width == s->img->width, s); |
| 2844 | } | 2847 | } |
| 2848 | |||
| 2849 | /* If there is no mask, the background won't be seen, | ||
| 2850 | so draw a rectangle on the image for the cursor. | ||
| 2851 | Do this for all images, getting trancparency right is not reliable. */ | ||
| 2852 | if (s->hl == DRAW_CURSOR) | ||
| 2853 | { | ||
| 2854 | int thickness = abs (s->img->relief); | ||
| 2855 | if (thickness == 0) thickness = 1; | ||
| 2856 | ns_draw_box (br, thickness, FRAME_CURSOR_COLOR (s->f), 1, 1); | ||
| 2857 | } | ||
| 2845 | } | 2858 | } |
| 2846 | 2859 | ||
| 2847 | 2860 | ||