Detect if is retina.
This commit is contained in:
parent
983b307429
commit
74f608d38c
@ -32,6 +32,7 @@ app.on('ready', () =>
|
|||||||
app.win = new BrowserWindow({width: 400, height: 420, minWidth: 400, minHeight: 420,webPreferences: {zoomFactor: 1.0}, backgroundColor:"#000", frame:false, autoHideMenuBar: true, icon: __dirname + '/icon.ico'})
|
app.win = new BrowserWindow({width: 400, height: 420, minWidth: 400, minHeight: 420,webPreferences: {zoomFactor: 1.0}, backgroundColor:"#000", frame:false, autoHideMenuBar: true, icon: __dirname + '/icon.ico'})
|
||||||
|
|
||||||
app.win.loadURL(`file://${__dirname}/sources/index.html`);
|
app.win.loadURL(`file://${__dirname}/sources/index.html`);
|
||||||
|
app.win.scaleFactor = require('electron').screen.getPrimaryDisplay().scaleFactor
|
||||||
|
|
||||||
app.win.on('closed', () => {
|
app.win.on('closed', () => {
|
||||||
win = null
|
win = null
|
||||||
|
@ -507,7 +507,6 @@ String.prototype.capitalize = function()
|
|||||||
return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase();
|
return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function is_json(text){ try{ JSON.parse(text);return true; } catch(error){ return false; }}
|
function is_json(text){ try{ JSON.parse(text);return true; } catch(error){ return false; }}
|
||||||
function pos_is_equal(a,b){ return a && b && a.x == b.x && a.y == b.y }
|
function pos_is_equal(a,b){ return a && b && a.x == b.x && a.y == b.y }
|
||||||
function clamp(v, min, max) { return v < min ? min : v > max ? max : v; }
|
function clamp(v, min, max) { return v < min ? min : v > max ? max : v; }
|
||||||
|
@ -8,7 +8,7 @@ function Guide()
|
|||||||
this.el.style.height = "320px";
|
this.el.style.height = "320px";
|
||||||
this.show_extras = true;
|
this.show_extras = true;
|
||||||
|
|
||||||
var scale = 2;
|
var scale = require('electron').remote.getCurrentWindow().scaleFactor;
|
||||||
|
|
||||||
this.start = function()
|
this.start = function()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user