[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 67676bb 1/2: Fix NS port text decorations (bug#52156)
From: |
Alan Third |
Subject: |
master 67676bb 1/2: Fix NS port text decorations (bug#52156) |
Date: |
Mon, 29 Nov 2021 17:13:16 -0500 (EST) |
branch: master
commit 67676bb5a04fe0f09037c6938579903c9426acc6
Author: Alan Third <alan@idiocy.org>
Commit: Alan Third <alan@idiocy.org>
Fix NS port text decorations (bug#52156)
* src/nsterm.m (ns_draw_text_decoration): Set the correct colors for
decorations other than underline.
(ns_draw_glyph_string): Remove superfluous color setting call.
---
src/nsterm.m | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/nsterm.m b/src/nsterm.m
index 747539e..78bbae6 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3307,16 +3307,17 @@ ns_draw_text_decoration (struct glyph_string *s, struct
face *face,
if (s->hl == DRAW_CURSOR)
[FRAME_BACKGROUND_COLOR (s->f) set];
- else if (face->underline_defaulted_p)
- [defaultCol set];
else
- [ns_lookup_indexed_color (face->underline_color, s->f) set];
+ [defaultCol set];
/* Do underline. */
if (face->underline)
{
if (s->face->underline == FACE_UNDER_WAVE)
{
+ if (!face->underline_defaulted_p)
+ [ns_lookup_indexed_color (face->underline_color, s->f) set];
+
ns_draw_underwave (s, width, x);
}
else if (s->face->underline == FACE_UNDER_LINE)
@@ -3387,6 +3388,9 @@ ns_draw_text_decoration (struct glyph_string *s, struct
face *face,
s->underline_position = position;
r = NSMakeRect (x, s->ybase + position, width, thickness);
+
+ if (!face->underline_defaulted_p)
+ [ns_lookup_indexed_color (face->underline_color, s->f) set];
NSRectFill (r);
}
}
@@ -3396,6 +3400,10 @@ ns_draw_text_decoration (struct glyph_string *s, struct
face *face,
{
NSRect r;
r = NSMakeRect (x, s->y, width, 1);
+
+ if (!face->overline_color_defaulted_p)
+ [ns_lookup_indexed_color (face->overline_color, s->f) set];
+
NSRectFill (r);
}
@@ -3418,6 +3426,9 @@ ns_draw_text_decoration (struct glyph_string *s, struct
face *face,
dy = lrint ((glyph_height - h) / 2);
r = NSMakeRect (x, glyph_y + dy, width, 1);
+ if (!face->strike_through_color_defaulted_p)
+ [ns_lookup_indexed_color (face->strike_through_color, s->f) set];
+
NSRectFill (r);
}
}
@@ -4066,7 +4077,6 @@ ns_draw_glyph_string (struct glyph_string *s)
? ns_lookup_indexed_color (NS_FACE_FOREGROUND
(s->face),
s->f)
: FRAME_FOREGROUND_COLOR (s->f));
- [col set];
/* Draw underline, overline, strike-through. */
ns_draw_text_decoration (s, s->face, col, s->width, s->x);