diff options
| author | Jan Djärv | 2010-12-05 11:33:48 +0100 |
|---|---|---|
| committer | Jan Djärv | 2010-12-05 11:33:48 +0100 |
| commit | a56d164e67624f351b2b89a340fa212f8c5b8efd (patch) | |
| tree | 28b3b2682790bb246bc3fccd8a46310a6b3ff72e /src | |
| parent | f9fe1af93762cdb8d4ea326c1ee6b8f46dec6cc9 (diff) | |
| download | emacs-a56d164e67624f351b2b89a340fa212f8c5b8efd.tar.gz emacs-a56d164e67624f351b2b89a340fa212f8c5b8efd.zip | |
Fix for 7412 (no cursor on image) backported from trunk.
* 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 95f7039eaf7..d10b5d194a9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-12-05 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-05 Chong Yidong <cyd@stupidchicken.com> | 6 | 2010-12-05 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 7 | ||
| 3 | * xdisp.c (try_scrolling): Avoid infloop if the first line is | 8 | * xdisp.c (try_scrolling): Avoid infloop if the first line is |
diff --git a/src/nsterm.m b/src/nsterm.m index 43e53cb30e7..38376e4eb08 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -2753,7 +2753,10 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r) | |||
| 2753 | else | 2753 | else |
| 2754 | face = FACE_FROM_ID (s->f, s->first_glyph->face_id); | 2754 | face = FACE_FROM_ID (s->f, s->first_glyph->face_id); |
| 2755 | 2755 | ||
| 2756 | [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f) set]; | 2756 | if (s->hl == DRAW_CURSOR) |
| 2757 | [FRAME_CURSOR_COLOR (s->f) set]; | ||
| 2758 | else | ||
| 2759 | [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f) set]; | ||
| 2757 | 2760 | ||
| 2758 | if (bg_height > s->slice.height || s->img->hmargin || s->img->vmargin | 2761 | if (bg_height > s->slice.height || s->img->hmargin || s->img->vmargin |
| 2759 | || s->img->mask || s->img->pixmap == 0 || s->width != s->background_width) | 2762 | || s->img->mask || s->img->pixmap == 0 || s->width != s->background_width) |
| @@ -2816,6 +2819,16 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r) | |||
| 2816 | s->slice.x == 0, | 2819 | s->slice.x == 0, |
| 2817 | s->slice.x + s->slice.width == s->img->width, s); | 2820 | s->slice.x + s->slice.width == s->img->width, s); |
| 2818 | } | 2821 | } |
| 2822 | |||
| 2823 | /* If there is no mask, the background won't be seen, | ||
| 2824 | so draw a rectangle on the image for the cursor. | ||
| 2825 | Do this for all images, getting trancparency right is not reliable. */ | ||
| 2826 | if (s->hl == DRAW_CURSOR) | ||
| 2827 | { | ||
| 2828 | int thickness = abs (s->img->relief); | ||
| 2829 | if (thickness == 0) thickness = 1; | ||
| 2830 | ns_draw_box (br, thickness, FRAME_CURSOR_COLOR (s->f), 1, 1); | ||
| 2831 | } | ||
| 2819 | } | 2832 | } |
| 2820 | 2833 | ||
| 2821 | 2834 | ||