Skip to content

Instantly share code, notes, and snippets.

@wasit-shafi
Created July 26, 2021 20:50
Show Gist options
  • Save wasit-shafi/68086a64c780040628aea3c071350390 to your computer and use it in GitHub Desktop.
Save wasit-shafi/68086a64c780040628aea3c071350390 to your computer and use it in GitHub Desktop.
electron-aspect-ratio-on-maximise
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