diff --git a/extension.js b/extension.js index c43d572..e2a29d9 100644 --- a/extension.js +++ b/extension.js @@ -26,7 +26,7 @@ var _log = function(str) { let config = { cols: 2, useMaximize: true, - close: 50, + close: 75, debug: true } @@ -665,6 +665,26 @@ function checkIfNearGrid(app) { showPreview(i, 1, grid_x, space.y+rowHeight, colWidth, rowHeight) close = true; break; + } else if ((isClose(x, space.x) || x < space.x) && y > space.y && y < space.y+rowHeight) { + // If we are close to the top left, show the top left grid item + showPreview(0, 0, space.x, space.y, colWidth, rowHeight) + close = true; + break; + } else if ((isClose(x, space.x) || x < space.x) && y > space.y+rowHeight) { + // If we are close to the bottom left, show the bottom left grid item + showPreview(0, 1, space.x, space.y+rowHeight, colWidth, rowHeight) + close = true; + break; + } else if ((isClose(x, space.x+space.width) || x > space.x+space.width) && y > space.y && y < space.y+rowHeight) { + // If we are close to the top right, show the top right grid item + showPreview(config.cols, 0, space.x+space.width-colWidth, space.y, colWidth, rowHeight) + close = true; + break; + } else if ((isClose(x, space.x+space.width) || x > space.x+space.width) && y > space.y+rowHeight) { + // If we are close to the bottom right, show the bottom right grid item + showPreview(config.cols, 1, space.x+space.width-colWidth, space.y+rowHeight, colWidth, rowHeight) + close = true; + break; } } if (!close)