diff options
| author | Po Lu | 2022-10-05 08:31:44 +0800 |
|---|---|---|
| committer | Po Lu | 2022-10-05 08:32:00 +0800 |
| commit | 6430c4c44f3cbfdaa702302017afbc5d442960f3 (patch) | |
| tree | b1e424910d568d36810afd06ebb5a8a955630edb /src | |
| parent | a259d0dda3878a64373b808627c4b4cab3971194 (diff) | |
| download | emacs-6430c4c44f3cbfdaa702302017afbc5d442960f3.tar.gz emacs-6430c4c44f3cbfdaa702302017afbc5d442960f3.zip | |
Fix bug in "macintization" of x_draw_glyph_string
* src/nsterm.m (ns_draw_stretch_glyph_string): Restore text decoration
drawing code ommitted during "macintization" to convert the X function
into NS code. Reported by Qiantan Hong <qthong@stanford.edu>.
Diffstat (limited to 'src')
| -rw-r--r-- | src/nsterm.m | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/nsterm.m b/src/nsterm.m index b68a6f8ec12..82fe58e90ec 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -3995,6 +3995,7 @@ static void | |||
| 3995 | ns_draw_stretch_glyph_string (struct glyph_string *s) | 3995 | ns_draw_stretch_glyph_string (struct glyph_string *s) |
| 3996 | { | 3996 | { |
| 3997 | struct face *face; | 3997 | struct face *face; |
| 3998 | NSColor *fg_color; | ||
| 3998 | 3999 | ||
| 3999 | if (s->hl == DRAW_CURSOR | 4000 | if (s->hl == DRAW_CURSOR |
| 4000 | && !x_stretch_cursor_p) | 4001 | && !x_stretch_cursor_p) |
| @@ -4091,8 +4092,20 @@ ns_draw_stretch_glyph_string (struct glyph_string *s) | |||
| 4091 | NSRectFill (NSMakeRect (x, s->y, background_width, s->height)); | 4092 | NSRectFill (NSMakeRect (x, s->y, background_width, s->height)); |
| 4092 | } | 4093 | } |
| 4093 | } | 4094 | } |
| 4094 | } | ||
| 4095 | 4095 | ||
| 4096 | /* Draw overlining, etc. on the stretch glyph (or the part of the | ||
| 4097 | stretch glyph after the cursor). If the glyph has a box, then | ||
| 4098 | decorations will be drawn after drawing the box in | ||
| 4099 | ns_draw_glyph_string, in order to prevent them from being | ||
| 4100 | overwritten by the box. */ | ||
| 4101 | if (s->face->box == FACE_NO_BOX) | ||
| 4102 | { | ||
| 4103 | fg_color = [NSColor colorWithUnsignedLong: | ||
| 4104 | NS_FACE_FOREGROUND (s->face)]; | ||
| 4105 | ns_draw_text_decoration (s, s->face, fg_color, | ||
| 4106 | s->background_width, s->x); | ||
| 4107 | } | ||
| 4108 | } | ||
| 4096 | 4109 | ||
| 4097 | static void | 4110 | static void |
| 4098 | ns_draw_glyph_string_foreground (struct glyph_string *s) | 4111 | ns_draw_glyph_string_foreground (struct glyph_string *s) |
| @@ -4410,7 +4423,8 @@ ns_draw_glyph_string (struct glyph_string *s) | |||
| 4410 | { | 4423 | { |
| 4411 | NSColor *fg_color; | 4424 | NSColor *fg_color; |
| 4412 | 4425 | ||
| 4413 | fg_color = [NSColor colorWithUnsignedLong:NS_FACE_FOREGROUND (s->face)]; | 4426 | fg_color = [NSColor colorWithUnsignedLong: NS_FACE_FOREGROUND (s->face)]; |
| 4427 | |||
| 4414 | ns_draw_text_decoration (s, s->face, fg_color, | 4428 | ns_draw_text_decoration (s, s->face, fg_color, |
| 4415 | s->background_width, s->x); | 4429 | s->background_width, s->x); |
| 4416 | } | 4430 | } |