Skip to content

Commit

Permalink
wide glyphs: adding alternative patch ref. bakkeby#56
Browse files Browse the repository at this point in the history
  • Loading branch information
UtkarshVerma committed Sep 3, 2022
1 parent dd702b3 commit 7b3cb9b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1805,9 +1805,7 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
int width = charlen * win.cw;
Color *fg, *bg, *temp, revfg, revbg, truefg, truebg;
XRenderColor colfg, colbg;
#if !WIDE_GLYPHS_PATCH
XRectangle r;
#endif // WIDE_GLYPHS_PATCH

/* Fallback on color display for attributes not supported by the font */
if (base.mode & ATTR_ITALIC && base.mode & ATTR_BOLD) {
Expand Down Expand Up @@ -1960,19 +1958,22 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
xclear(winx, winy, winx + width, winy + win.ch);
else
#endif // BACKGROUND_IMAGE_PATCH
#if !WIDE_GLYPHS_PATCH
XftDrawRect(xw.draw, bg, winx, winy, width, win.ch);
#if WIDE_GLYPHS_PATCH
}
#endif // WIDE_GLYPHS_PATCH

#if !WIDE_GLYPHS_PATCH
/* Set the clip region because Xft is sometimes dirty. */
r.x = 0;
r.y = 0;
r.height = win.ch;
r.width = width;
XftDrawSetClipRectangles(xw.draw, winx, winy, &r, 1);
#endif // WIDE_GLYPHS_PATCH

#if WIDE_GLYPHS_PATCH
/* Fill the background */
XftDrawRect(xw.draw, bg, winx, winy, width, win.ch);
}
#endif // WIDE_GLYPHS_PATCH

#if WIDE_GLYPHS_PATCH
if (dmode & DRAW_FG) {
Expand Down Expand Up @@ -2367,10 +2368,8 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
}
#endif // WIDE_GLYPHS_PATCH

#if !WIDE_GLYPHS_PATCH
/* Reset clip to none. */
XftDrawSetClip(xw.draw, 0);
#endif // WIDE_GLYPHS_PATCH
}

void
Expand Down

0 comments on commit 7b3cb9b

Please sign in to comment.