Xinqi Bao's Git

make underlines and strikethroughs respect `chscale`
[st.git] / x.c
diff --git a/x.c b/x.c
index 5f4ea73..2a3bd38 100644 (file)
--- a/x.c
+++ b/x.c
@@ -415,7 +415,7 @@ mousereport(XEvent *e)
 
        if (!IS_SET(MODE_MOUSEX10)) {
                code += ((state & ShiftMask  ) ?  4 : 0)
-                     + ((state & Mod4Mask   ) ?  8 : 0)
+                     + ((state & Mod1Mask   ) ?  8 : 0) /* meta key: alt */
                      + ((state & ControlMask) ? 16 : 0);
        }
 
@@ -1493,12 +1493,12 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
 
        /* Render underline and strikethrough. */
        if (base.mode & ATTR_UNDERLINE) {
-               XftDrawRect(xw.draw, fg, winx, winy + dc.font.ascent + 1,
+               XftDrawRect(xw.draw, fg, winx, winy + dc.font.ascent * chscale + 1,
                                width, 1);
        }
 
        if (base.mode & ATTR_STRUCK) {
-               XftDrawRect(xw.draw, fg, winx, winy + 2 * dc.font.ascent / 3,
+               XftDrawRect(xw.draw, fg, winx, winy + 2 * dc.font.ascent * chscale / 3,
                                width, 1);
        }