fix back ronin.log
This commit is contained in:
parent
acea1ad26d
commit
a5afeb3784
@ -47,8 +47,8 @@ function Ronin () {
|
|||||||
this.theme.reset()
|
this.theme.reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
this.log = function (msg) {
|
this.log = function (...msg) {
|
||||||
console.log(msg)
|
console.log(...msg)
|
||||||
this.commander.setStatus(msg.reduce((acc, val) => { return acc + val + ' ' }, ''))
|
this.commander.setStatus(msg.reduce((acc, val) => { return acc + val + ' ' }, ''))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ function Surface (ronin) {
|
|||||||
const img = new Image()
|
const img = new Image()
|
||||||
img.src = path
|
img.src = path
|
||||||
img.onload = () => {
|
img.onload = () => {
|
||||||
//ronin.log(`Open ${img.width}x${img.height}`)
|
ronin.log(`Open ${img.width}x${img.height}`)
|
||||||
const rect = { x: 0, y: 0, w: img.width, h: img.height }
|
const rect = { x: 0, y: 0, w: img.width, h: img.height }
|
||||||
this.resize(rect, true)
|
this.resize(rect, true)
|
||||||
this.context.drawImage(img, 0, 0, img.width, img.height)
|
this.context.drawImage(img, 0, 0, img.width, img.height)
|
||||||
@ -123,7 +123,7 @@ function Surface (ronin) {
|
|||||||
this.draw = function (img, rect = this.getFrame()) {
|
this.draw = function (img, rect = this.getFrame()) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
img.onload = () => {
|
img.onload = () => {
|
||||||
//ronin.log(`Draw ${img.width}x${img.height}`)
|
ronin.log(`Draw ${img.width}x${img.height}`)
|
||||||
this.context.drawImage(img, rect.x, rect.y, rect.w, rect.h) // no strect: img.height * (rect.w / img.width)
|
this.context.drawImage(img, rect.x, rect.y, rect.w, rect.h) // no strect: img.height * (rect.w / img.width)
|
||||||
resolve()
|
resolve()
|
||||||
}
|
}
|
||||||
@ -131,7 +131,7 @@ function Surface (ronin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.crop = function (rect) {
|
this.crop = function (rect) {
|
||||||
// ronin.log(`Crop ${rect.w}x${rect.h} from ${rect.x}x${rect.y}`)
|
ronin.log(`Crop ${rect.w}x${rect.h} from ${rect.x}x${rect.y}`)
|
||||||
const crop = this.getCrop(rect)
|
const crop = this.getCrop(rect)
|
||||||
this.resize(rect, true)
|
this.resize(rect, true)
|
||||||
this.context.drawImage(crop, 0, 0)
|
this.context.drawImage(crop, 0, 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user