diff options
author | Anselm R. Garbe <garbeam@gmail.com> | 2007-08-17 21:10:50 +0200 |
---|---|---|
committer | Anselm R. Garbe <garbeam@gmail.com> | 2007-08-17 21:10:50 +0200 |
commit | a923298d3577dca0e69fd70edbef56c7822258e3 (patch) | |
tree | 074dd57439354630152d15564a0107cbb1a1eb1a /tile.c | |
parent | 04dec4c94390fdf57893615de5b5872dd5abbce4 (diff) | |
download | dwm-a923298d3577dca0e69fd70edbef56c7822258e3.tar.gz |
applied Jukka Salmi's setmwfact patch
Diffstat (limited to 'tile.c')
-rw-r--r-- | tile.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -9,18 +9,24 @@ static double mwfact = MWFACT; /* extern */ void -addtomwfact(const char *arg) { - double delta; +setmwfact(const char *arg) { + double delta, newfact; if(!isarrange(tile)) return; - /* arg handling, manipulate mwfact */ if(arg == NULL) mwfact = MWFACT; else if(1 == sscanf(arg, "%lf", &delta)) { - if(delta + mwfact > 0.1 && delta + mwfact < 0.9) - mwfact += delta; + if(arg[0] != '+' && arg[0] != '-') + newfact = delta; + else + newfact = mwfact + delta; + if(newfact < 0.1) + newfact = 0.1; + else if(newfact > 0.9) + newfact = 0.9; + mwfact = newfact; } arrange(); } |