Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Commit

Permalink
fix (I hope) issue with screen size
Browse files Browse the repository at this point in the history
  • Loading branch information
weiameili committed Dec 20, 2021
1 parent d5706b0 commit c2371e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ function createWindow() {
board.setResizable(false);

setTimeout(() => {
board.setPosition(
Math.min(...screen.getAllDisplays().map((j) => j.workArea.x)),
Math.min(...screen.getAllDisplays().map((j) => j.workArea.y))
);
board.setSize(
Math.max(
...screen
Expand All @@ -51,7 +47,11 @@ function createWindow() {
.map((j) => j.workArea.y + j.workArea.height)
) - Math.min(...screen.getAllDisplays().map((j) => j.workArea.y))
);
}, 100);
board.setPosition(
Math.min(...screen.getAllDisplays().map((j) => j.workArea.x)),
Math.min(...screen.getAllDisplays().map((j) => j.workArea.y))
);
}, 10);

const controller = new BrowserWindow({
width: Math.floor(
Expand Down
2 changes: 1 addition & 1 deletion scripts/board.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const Konva = require("konva");

console.log(window.innerWidth);
const stage = new Konva.Stage({
container: "container",
width: window.innerWidth,
Expand Down

0 comments on commit c2371e4

Please sign in to comment.