Fixed issue with window resizing

This commit is contained in:
Devine Lu Linvega 2019-07-18 19:33:32 +09:00
parent ad941de3a1
commit 61d34036cd
3 changed files with 5 additions and 4 deletions

View File

@ -173,7 +173,7 @@ function Library (ronin) {
for (let i = acc === undefined ? 1 : 0; i < length; i++) {
result = await fn(result, arr[i], i, arr)
}
return result;
return result
}
this.len = (item) => { // Returns the length of a list.

View File

@ -73,7 +73,7 @@ function Lisp (input, lib) {
return special[input[0].value](input, context)
}
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))
}
return list[0] instanceof Function ? list[0].apply(undefined, list.slice(1)) : list

View File

@ -182,7 +182,8 @@ function Surface (ronin) {
this.fitWindow = function (size) {
const win = require('electron').remote.getCurrentWindow()
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 () {
@ -229,7 +230,7 @@ function Surface (ronin) {
context = canvas.getContext('2d')
context.drawImage(tmp, 0, 0, cW, cH)
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
return resolve()
}