Fixed issue with window resizing
This commit is contained in:
parent
ad941de3a1
commit
61d34036cd
@ -173,7 +173,7 @@ function Library (ronin) {
|
|||||||
for (let i = acc === undefined ? 1 : 0; i < length; i++) {
|
for (let i = acc === undefined ? 1 : 0; i < length; i++) {
|
||||||
result = await fn(result, arr[i], i, arr)
|
result = await fn(result, arr[i], i, arr)
|
||||||
}
|
}
|
||||||
return result;
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
this.len = (item) => { // Returns the length of a list.
|
this.len = (item) => { // Returns the length of a list.
|
||||||
|
@ -73,7 +73,7 @@ function Lisp (input, lib) {
|
|||||||
return special[input[0].value](input, context)
|
return special[input[0].value](input, context)
|
||||||
}
|
}
|
||||||
const list = []
|
const list = []
|
||||||
for(let i = 0; i < input.length; i++) {
|
for (let i = 0; i < input.length; i++) {
|
||||||
list.push(await interpret(input[i], context))
|
list.push(await interpret(input[i], context))
|
||||||
}
|
}
|
||||||
return list[0] instanceof Function ? list[0].apply(undefined, list.slice(1)) : list
|
return list[0] instanceof Function ? list[0].apply(undefined, list.slice(1)) : list
|
||||||
|
@ -182,7 +182,8 @@ function Surface (ronin) {
|
|||||||
this.fitWindow = function (size) {
|
this.fitWindow = function (size) {
|
||||||
const win = require('electron').remote.getCurrentWindow()
|
const win = require('electron').remote.getCurrentWindow()
|
||||||
const pad = { w: ronin.commander.isVisible === true ? 400 : 60, h: 60 }
|
const pad = { w: ronin.commander.isVisible === true ? 400 : 60, h: 60 }
|
||||||
win.setSize(size.w + pad.w, size.h + pad.h, true)
|
if (size.w < 10 || size.h < 10) { return }
|
||||||
|
win.setSize(Math.floor(size.w + pad.w), Math.floor(size.h + pad.h), true)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.maximize = function () {
|
this.maximize = function () {
|
||||||
@ -229,7 +230,7 @@ function Surface (ronin) {
|
|||||||
context = canvas.getContext('2d')
|
context = canvas.getContext('2d')
|
||||||
context.drawImage(tmp, 0, 0, cW, cH)
|
context.drawImage(tmp, 0, 0, cW, cH)
|
||||||
dst.src = canvas.toDataURL(type, quality)
|
dst.src = canvas.toDataURL(type, quality)
|
||||||
if (cW <= src.width || cH <= src.height) { return resolve()}
|
if (cW <= src.width || cH <= src.height) { return resolve() }
|
||||||
tmp.src = dst.src
|
tmp.src = dst.src
|
||||||
return resolve()
|
return resolve()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user