emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 0ee1a46: Fix overline display over stretch glyphs with box on NS


From: Po Lu
Subject: master 0ee1a46: Fix overline display over stretch glyphs with box on NS
Date: Sun, 12 Dec 2021 08:35:59 -0500 (EST)

branch: master
commit 0ee1a46e6c7fa159584a9c04f5ab9bf694d6de3b
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix overline display over stretch glyphs with box on NS
    
    * src/nsterm.m (ns_dumpglyphs_stretch): Don't draw text
    decorations when there is a box.
    (ns_draw_glyph_string): Draw text decorations after the box
    in stretch glyph that have one.
---
 src/nsterm.m | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/src/nsterm.m b/src/nsterm.m
index 5d39be3..4e5ce5e 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3858,10 +3858,14 @@ ns_dumpglyphs_stretch (struct glyph_string *s)
 
       NSRectFill (glyphRect);
 
-      /* Draw overlining, etc. on the stretch glyph (or the part
-         of the stretch glyph after the cursor). */
-      ns_draw_text_decoration (s, face, fgCol, NSWidth (glyphRect),
-                               NSMinX (glyphRect));
+      /* Draw overlining, etc. on the stretch glyph (or the part of
+         the stretch glyph after the cursor).  If the glyph has a box,
+         then decorations will be drawn after drawing the box in
+         ns_draw_glyph_string, in order to prevent them from being
+         overwritten by the box.  */
+      if (s->face->box != FACE_NO_BOX)
+       ns_draw_text_decoration (s, face, fgCol, NSWidth (glyphRect),
+                                NSMinX (glyphRect));
 
       s->background_filled_p = 1;
     }
@@ -4105,6 +4109,16 @@ ns_draw_glyph_string (struct glyph_string *s)
   if (!s->for_overlaps && !box_drawn_p && s->face->box != FACE_NO_BOX)
     ns_dumpglyphs_box_or_relief (s);
 
+  if (s->face->box != FACE_NO_BOX
+      && s->first_glyph->type == STRETCH_GLYPH)
+    {
+      NSColor *fg_color;
+
+      fg_color = ns_lookup_indexed_color (NS_FACE_FOREGROUND (s->face), s->f);
+      ns_draw_text_decoration (s, s->face, fg_color,
+                              s->background_width, s->x);
+    }
+
   ns_unfocus (s->f);
 
   /* Draw surrounding overhangs. */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]