]> git.eshelyaron.com Git - emacs.git/commitdiff
Make overhangs in ftcrfont work on Haiku
authorPo Lu <luangruo@yahoo.com>
Mon, 29 Nov 2021 07:12:25 +0000 (07:12 +0000)
committerPo Lu <luangruo@yahoo.com>
Mon, 29 Nov 2021 07:12:25 +0000 (07:12 +0000)
* src/ftcrfont.c (ftcrfont_draw): Dump left overhang clipping
on Haiku and always set `background_filled_p'.

src/ftcrfont.c

index 5d75f183570e9a053e91032eb854e7bfcfdf83ad..820b3c0bd0c66144ac3265a02849e097a9f67da2 100644 (file)
@@ -539,13 +539,19 @@ ftcrfont_draw (struct glyph_string *s,
       return 0;
     }
   BView_cr_dump_clipping (FRAME_HAIKU_VIEW (f), cr);
+
+  if (s->left_overhang && s->clip_head && !s->for_overlaps)
+    {
+      cairo_rectangle (cr, s->clip_head->x, 0,
+                      FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f));
+      cairo_clip (cr);
+    }
 #endif
 
   if (with_background)
     {
 #ifndef USE_BE_CAIRO
       x_set_cr_source_with_gc_background (f, s->gc);
-      s->background_filled_p = 1;
 #else
       struct face *face = s->face;
 
@@ -556,6 +562,7 @@ ftcrfont_draw (struct glyph_string *s,
                            GREEN_FROM_ULONG (col) / 255.0,
                            BLUE_FROM_ULONG (col) / 255.0);
 #endif
+      s->background_filled_p = 1;
       cairo_rectangle (cr, x, y - FONT_BASE (face->font),
                       s->width, FONT_HEIGHT (face->font));
       cairo_fill (cr);