From 0b429b499463903ba9c9a68657657dbe22cf4f11 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Sun, 10 May 2020 17:11:05 +0200 Subject: [PATCH] Fibonacci updates --- patch/flextile-deluxe.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/patch/flextile-deluxe.c b/patch/flextile-deluxe.c index 4c037fd..986460f 100644 --- a/patch/flextile-deluxe.c +++ b/patch/flextile-deluxe.c @@ -446,11 +446,11 @@ arrange_gapplessgrid(Monitor *m, int x, int y, int h, int w, int ih, int iv, int for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { if (i >= ai && i < (ai + an)) { - if (cc/rows + 1 > cols - an%cols) { + if (cc/rows + 1 > cols - an%cols) { rows = an/cols + 1; ch = (h - ih * (rows - 1)) / rows; rrest = (h - ih * (rows - 1)) - ch * rows; - } + } resize(c, x, y + rn*(ch + ih) + MIN(rn, rrest), @@ -537,10 +537,14 @@ arrange_fibonacci(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, ny += nh + ih; } if ((i % 4) == 0) { - if (s) + if (s) { ny += nh + ih; - else + nh += hrest; + } + else { + nh -= hrest; ny -= nh + ih; + } } else if ((i % 4) == 1) { nx += nw + iv; @@ -559,11 +563,14 @@ arrange_fibonacci(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, } else { nw -= wrest; nx -= nw + iv; + nh += hrest; } } if (i == 0) { - if (an != 1) - nw = (w - iv) * m->mfact; + if (an != 1) { + nw = (w - iv) - (w - iv) * (1 - m->mfact); + wrest = 0; + } ny = y; } else if (i == 1)