Created
July 26, 2021 20:50
-
-
Save wasit-shafi/68086a64c780040628aea3c071350390 to your computer and use it in GitHub Desktop.
electron-aspect-ratio-on-maximise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { app, BrowserWindow } = require('electron'); | |
const createWindow = () => { | |
const win = new BrowserWindow({ | |
width: 500, | |
height: 500, | |
fullscreenable: false, | |
}); | |
win.setAspectRatio(1); | |
win.loadFile('index.html'); | |
}; | |
app | |
.whenReady() | |
.then(() => { | |
createWindow(); | |
}) | |
.catch((e) => { | |
console.log('error : ', e); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment