Skip to content

Commit 41b0492

Browse files
committed
Fix BrowserWindow size (use content size)
1 parent 1ad3ce4 commit 41b0492

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

p5js/js/electron/main.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ const { app, BrowserWindow, globalShortcut, ipcMain } = require('electron');
33

44
const createWindow = () => {
55
const win = new BrowserWindow({
6-
show: false,
76
width: 400,
87
height: 400,
9-
useContentSize: true,
8+
show: false,
109
autoHideMenuBar: true,
1110
alwaysOnTop: true,
1211
webPreferences: {
@@ -45,7 +44,7 @@ app.whenReady().then(() => {
4544
});
4645

4746
ipcMain.on("resize", (event, {width, height}) => {
48-
win.setSize(width, height);
47+
win.setContentSize(width, height);
4948
win.show();
5049
});
5150
});

0 commit comments

Comments
 (0)