diff options
author | Quentin Rameau <quinq@quinq.eu.org> | 2015-05-31 12:26:11 +0200 |
---|---|---|
committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2015-06-19 11:49:13 +0200 |
commit | bdd649a10289ade364f3deab3bbf6ee3169d67ca (patch) | |
tree | 36b8019d0d2dc154d0fe646c7894ea32675c744e /st.c | |
parent | 71fa10f613a22b3e75e0e897ee1be6667be3f449 (diff) | |
download | st-bdd649a10289ade364f3deab3bbf6ee3169d67ca.tar.gz st-bdd649a10289ade364f3deab3bbf6ee3169d67ca.tar.bz2 st-bdd649a10289ade364f3deab3bbf6ee3169d67ca.zip |
do not truncate font size when zooming
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -3061,7 +3061,6 @@ xloadfont(Font *f, FcPattern *pattern) { void xloadfonts(char *fontstr, double fontsize) { FcPattern *pattern; - FcResult r_sz, r_psz; double fontval; float ceilf(float); @@ -3080,11 +3079,11 @@ xloadfonts(char *fontstr, double fontsize) { FcPatternAddDouble(pattern, FC_PIXEL_SIZE, (double)fontsize); usedfontsize = fontsize; } else { - r_psz = FcPatternGetDouble(pattern, FC_PIXEL_SIZE, 0, &fontval); - r_sz = FcPatternGetDouble(pattern, FC_SIZE, 0, &fontval); - if(r_psz == FcResultMatch) { + if(FcPatternGetDouble(pattern, FC_PIXEL_SIZE, 0, &fontval) == + FcResultMatch) { usedfontsize = fontval; - } else if(r_sz == FcResultMatch) { + } else if(FcPatternGetDouble(pattern, FC_SIZE, 0, &fontval) == + FcResultMatch) { usedfontsize = -1; } else { /* @@ -3157,14 +3156,14 @@ void xzoom(const Arg *arg) { Arg larg; - larg.i = usedfontsize + arg->i; + larg.f = usedfontsize + arg->f; xzoomabs(&larg); } void xzoomabs(const Arg *arg) { xunloadfonts(); - xloadfonts(usedfont, arg->i); + xloadfonts(usedfont, arg->f); cresize(0, 0); redraw(); xhints(); @@ -3175,7 +3174,7 @@ xzoomreset(const Arg *arg) { Arg larg; if(defaultfontsize > 0) { - larg.i = defaultfontsize; + larg.f = defaultfontsize; xzoomabs(&larg); } } |