aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Reitter2009-05-07 13:46:56 +0000
committerDavid Reitter2009-05-07 13:46:56 +0000
commit85bd26158c7beb20210b8d4ef9986f3e5bfbadd2 (patch)
tree522ac3226dd2749bf4361f92782cebff2b8fc2ca /src
parent2d82a920da2ba5b7385d5f978026e5380746fa2d (diff)
downloademacs-85bd26158c7beb20210b8d4ef9986f3e5bfbadd2.tar.gz
emacs-85bd26158c7beb20210b8d4ef9986f3e5bfbadd2.zip
ns_dumpglyphs_stretch, ns_dumpglyphs_image: respect mouse face background.
Diffstat (limited to 'src')
-rw-r--r--src/nsterm.m30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index aeeae4b20da..a76b7e70bc9 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -2808,6 +2808,7 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r)
2808 int th; 2808 int th;
2809 char raised_p; 2809 char raised_p;
2810 NSRect br; 2810 NSRect br;
2811 struct face *face;
2811 2812
2812 NSTRACE (ns_dumpglyphs_image); 2813 NSTRACE (ns_dumpglyphs_image);
2813 2814
@@ -2827,8 +2828,17 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r)
2827 /* Draw BG: if we need larger area than image itself cleared, do that, 2828 /* Draw BG: if we need larger area than image itself cleared, do that,
2828 otherwise, since we composite the image under NS (instead of mucking 2829 otherwise, since we composite the image under NS (instead of mucking
2829 with its background color), we must clear just the image area. */ 2830 with its background color), we must clear just the image area. */
2830 [ns_lookup_indexed_color (NS_FACE_BACKGROUND 2831 if (s->hl == DRAW_MOUSE_FACE)
2831 (FACE_FROM_ID (s->f, s->first_glyph->face_id)), s->f) set]; 2832 {
2833 face = FACE_FROM_ID
2834 (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id);
2835 if (!face)
2836 face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
2837 }
2838 else
2839 face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
2840
2841 [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f) set];
2832 2842
2833 if (bg_height > s->slice.height || s->img->hmargin || s->img->vmargin 2843 if (bg_height > s->slice.height || s->img->hmargin || s->img->vmargin
2834 || s->img->mask || s->img->pixmap == 0 || s->width != s->background_width) 2844 || s->img->mask || s->img->pixmap == 0 || s->width != s->background_width)
@@ -2899,6 +2909,7 @@ ns_dumpglyphs_stretch (struct glyph_string *s)
2899{ 2909{
2900 NSRect r[2]; 2910 NSRect r[2];
2901 int n, i; 2911 int n, i;
2912 struct face *face;
2902 2913
2903 if (!s->background_filled_p) 2914 if (!s->background_filled_p)
2904 { 2915 {
@@ -2940,8 +2951,19 @@ ns_dumpglyphs_stretch (struct glyph_string *s)
2940 } 2951 }
2941 2952
2942 ns_focus (s->f, r, n); 2953 ns_focus (s->f, r, n);
2943 [ns_lookup_indexed_color (NS_FACE_BACKGROUND 2954
2944 (FACE_FROM_ID (s->f, s->first_glyph->face_id)), s->f) set]; 2955 if (s->hl == DRAW_MOUSE_FACE)
2956 {
2957 face = FACE_FROM_ID
2958 (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id);
2959 if (!face)
2960 face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
2961 }
2962 else
2963 face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
2964
2965 [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f) set];
2966
2945 NSRectFill (r[0]); 2967 NSRectFill (r[0]);
2946 NSRectFill (r[1]); 2968 NSRectFill (r[1]);
2947 ns_unfocus (s->f); 2969 ns_unfocus (s->f);