From 8d86cffabd121383047f137d810e3eb269bf110f Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 8 Feb 2017 16:07:25 -0800 Subject: [PATCH] standard --- src/main/dock.js | 2 +- src/main/windows/main.js | 4 ++-- test/setup.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/dock.js b/src/main/dock.js index c882f1a0..1eaabd7d 100644 --- a/src/main/dock.js +++ b/src/main/dock.js @@ -32,7 +32,7 @@ function downloadFinished (path) { */ function setBadge (count) { if (process.platform === 'darwin' || - process.platform === 'linux' && app.isUnityRunning()) { + (process.platform === 'linux' && app.isUnityRunning())) { log(`setBadge: ${count}`) app.setBadgeCount(Number(count)) } diff --git a/src/main/windows/main.js b/src/main/windows/main.js index 2e65a720..104ac132 100644 --- a/src/main/windows/main.js +++ b/src/main/windows/main.js @@ -166,8 +166,8 @@ function setBounds (bounds, maximize) { if (bounds.x === null && bounds.y === null) { // X and Y not specified? By default, center on current screen const scr = electron.screen.getDisplayMatching(main.win.getBounds()) - bounds.x = Math.round(scr.bounds.x + scr.bounds.width / 2 - bounds.width / 2) - bounds.y = Math.round(scr.bounds.y + scr.bounds.height / 2 - bounds.height / 2) + bounds.x = Math.round(scr.bounds.x + (scr.bounds.width / 2) - (bounds.width / 2)) + bounds.y = Math.round(scr.bounds.y + (scr.bounds.height / 2) - (bounds.height / 2)) log('setBounds: centered to ' + JSON.stringify(bounds)) } // Resize the window's content area (so window border doesn't need to be taken diff --git a/test/setup.js b/test/setup.js index fe537d14..7e8b932f 100644 --- a/test/setup.js +++ b/test/setup.js @@ -122,7 +122,7 @@ function compareIgnoringTransparency (bufActual, bufExpected) { const de = pngE.data for (let y = 0; y < h; y++) { for (let x = 0; x < w; x++) { - const i = (y * w + x) * 4 + const i = ((y * w) + x) * 4 if (de[i + 3] === 0) continue // Skip transparent pixels const ca = (da[i] << 16) | (da[i + 1] << 8) | da[i + 2] const ce = (de[i] << 16) | (de[i + 1] << 8) | de[i + 2]