This commit is contained in:
Feross Aboukhadijeh
2017-02-08 16:07:25 -08:00
parent 95d6ec5fdd
commit 8d86cffabd
3 changed files with 4 additions and 4 deletions

View File

@@ -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))
}

View File

@@ -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

View File

@@ -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]