Upgrade electron

This commit is contained in:
Mohammad Fares
2019-11-20 20:16:06 +01:00
parent bd37883479
commit 36acb5d514
4 changed files with 1496 additions and 1435 deletions

View File

@@ -44,7 +44,10 @@ function createWindow() {
var win = new BrowserWindow({
show: false,
width: 8000,
height: 8000
height: 8000,
webPreferences: {
nodeIntegration: true
}
});
// Load index.html

View File

@@ -116,14 +116,18 @@ function capture(frameIndex, callback) {
stepsCounter = (stepsCounter + 1) % step;
capturePage(captureRect, function(img) {
capturePage(captureRect).then((img) => {
var outputPath = path.join(renderDir, frameIndex + '.png');
fs.writeFileSync(outputPath, img.toPNG());
ipcRenderer.send('captured', frameIndex);
callback();
}).catch((err) => {
throw new err;
});
}