Skip to content

Commit

Permalink
remove gaps from between tiles
Browse files Browse the repository at this point in the history
If a screen doesn't evenly divide into columns, the last column will use up the
remaining pixels.

fixes #42
  • Loading branch information
GrylledCheez committed May 26, 2023
1 parent 5a1d88a commit 45c7b55
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,17 @@ function moveApp(app, loc) {
var colCount = config.cols === 2 || (config.ultrawideOnly && isNotUltrawide) ? 2 : config.cols;
if (loc.col >= colCount)
loc.col = 1;

var colWidth = Math.floor(space.width / colCount);
var rowHeight = Math.floor(space.height / 2);

let x = loc.col * colWidth + space.x;
let y = loc.row * rowHeight + space.y;
let w = loc.width * colWidth;
let h = loc.height * rowHeight;

if (loc.col + loc.width === colCount)
w += space.width % colCount;

if (!config.useMaximize) {
unMaximizeIfMaximized(app);
Expand Down

0 comments on commit 45c7b55

Please sign in to comment.