Skip to content
Permalink
Browse files

update bounds calculation (#768)

* update bounds calculation

* yet another bounds algorithm

* Revert "yet another bounds algorithm"

This reverts commit 0538b50.
  • Loading branch information
Manuel-777 committed Nov 28, 2019
1 parent 7084a3f commit 9cf990194261706c11f812f376c8f69a0b47e124
Showing with 12 additions and 2 deletions.
  1. +12 −2 src/main.js
@@ -446,16 +446,26 @@ function updateOverlayVisibility() {
electron.screen.getAllDisplays().forEach(display => {
newBounds.x = Math.min(newBounds.x, display.bounds.x);
newBounds.y = Math.min(newBounds.y, display.bounds.y);
});
electron.screen.getAllDisplays().forEach(display => {
newBounds.width = Math.max(
newBounds.width,
display.bounds.x + display.bounds.width
Math.abs(newBounds.x) + display.bounds.x + display.bounds.width
);
newBounds.height = Math.max(
newBounds.height,
display.bounds.y + display.bounds.height
Math.abs(newBounds.y) + display.bounds.y + display.bounds.height
);
});

console.log(
"Overlay bounds: ",
newBounds.x,
newBounds.y,
newBounds.width,
newBounds.height
);

overlay.setBounds(newBounds);
overlay.show();
}

0 comments on commit 9cf9901

Please sign in to comment.
You can’t perform that action at this time.