From af84f1e0bd0ca81148797ee9a1dbfcd648be44ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Wed, 6 Sep 2017 23:32:59 +0200 Subject: [PATCH] Only use margin if there's windows to the left/right --- tiling.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tiling.js b/tiling.js index 41c237e..9170b24 100644 --- a/tiling.js +++ b/tiling.js @@ -46,12 +46,15 @@ ensure_viewport = (meta_window) => { let [start, end] = rect(meta_window) let index = pages.indexOf(meta_window) + let margin = overlap*2 + if (index == pages.length - 1 || index == 0) + margin = 0 if (end > global.screen_width) { propogate_forward(index + 1, global.screen_width) - propogate_backward(index, global.screen_width - overlap*2) + propogate_backward(index, global.screen_width - margin) } else if (start < 0) { - propogate_forward(index, overlap*2) + propogate_forward(index, margin) propogate_backward(index - 1, -global.screen_width) } }