]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix display of glyphless characters on Haiku
authorPo Lu <luangruo@yahoo.com>
Tue, 19 Apr 2022 01:15:33 +0000 (01:15 +0000)
committerPo Lu <luangruo@yahoo.com>
Tue, 19 Apr 2022 01:15:33 +0000 (01:15 +0000)
* src/haikuterm.c (haiku_draw_glyph_string_foreground): Fix pen
size when drawing composite string w/o font.
(haiku_draw_glyphless_glyph_string_foreground): Correctly
display glyphless character rectangle.

src/haikuterm.c

index 203bfa3f81a1b63b28fe5753dd40aafb06b7d8f2..9cd1d0f0158cb2679933ace8e312861d9584998d 100644 (file)
@@ -1059,6 +1059,8 @@ haiku_draw_glyph_string_foreground (struct glyph_string *s)
       for (i = 0; i < s->nchars; ++i)
        {
          struct glyph *g = s->first_glyph + i;
+
+         BView_SetPenSize (view, 1);
          BView_StrokeRectangle (view, x, s->y, g->pixel_width,
                                 s->height);
          x += g->pixel_width;
@@ -1090,6 +1092,7 @@ haiku_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
   unsigned char2b[8];
   int x, i, j;
   struct face *face = s->face;
+  unsigned long color;
 
   /* If first glyph of S has a left box line, start drawing the text
      of S to the right of that box line.  */
@@ -1153,11 +1156,21 @@ haiku_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
                                 s->ybase + glyph->slice.glyphless.lower_yoff,
                                 false);
        }
+
       if (glyph->u.glyphless.method != GLYPHLESS_DISPLAY_THIN_SPACE)
-       BView_FillRectangle (FRAME_HAIKU_VIEW (s->f),
-                            x, s->ybase - glyph->ascent,
-                            glyph->pixel_width - 1,
-                            glyph->ascent + glyph->descent - 1);
+       {
+         if (s->hl == DRAW_CURSOR)
+           haiku_merge_cursor_foreground (s, NULL, &color);
+         else
+           color = s->face->foreground;
+
+         BView_SetHighColor (FRAME_HAIKU_VIEW (s->f), color);
+         BView_SetPenSize (FRAME_HAIKU_VIEW (s->f), 1);
+         BView_StrokeRectangle (FRAME_HAIKU_VIEW (s->f),
+                                x, s->ybase - glyph->ascent,
+                                glyph->pixel_width - 1,
+                                glyph->ascent + glyph->descent - 1);
+       }
       x += glyph->pixel_width;
    }
 }