aboutsummaryrefslogtreecommitdiff
path: root/fibonacci.c
diff options
context:
space:
mode:
Diffstat (limited to 'fibonacci.c')
-rw-r--r--fibonacci.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/fibonacci.c b/fibonacci.c
index 8ea99e7..6896f86 100644
--- a/fibonacci.c
+++ b/fibonacci.c
@@ -7,15 +7,15 @@ fibonacci(Monitor *mon, int s) {
if(n == 0)
return;
- ng = mon->gappx;
- nx = mon->wx + ng;
- ny = ng;
- nw = mon->ww - 2*ng;
- nh = mon->wh - 2*ng;
+ ng = mon->gappx;
+ nx = mon->wx;
+ ny = 0;
+ nw = mon->ww;
+ nh = mon->wh;
for(i = 0, c = nexttiled(mon->clients); c; c = nexttiled(c->next)) {
- if((i % 2 && nh / 2 > 2 * c->bw)
- || (!(i % 2) && nw / 2 > 2 * c->bw)) {
+ if((i % 2 && nh / 2 > 2 * (c->bw))
+ || (!(i % 2) && nw / 2 > 2 * (c->bw))) {
if(i < n - 1) {
if(i % 2)
nh /= 2;
@@ -49,10 +49,11 @@ fibonacci(Monitor *mon, int s) {
ny = mon->wy;
}
else if(i == 1)
- nw = mon->ww - nw;
+ nw = mon->ww - nw;
i++;
}
- resize(c, nx, ny, nw - 2 * c->bw - 2*ng, nh - 2 * c->bw - 2*ng, False);
+
+ resize(c, nx + ng, ny + ng, nw - 2 * (c->bw + ng), nh - 2 * (c->bw + ng), False);
}
}