fix back ronin.log
This commit is contained in:
parent
acea1ad26d
commit
a5afeb3784
@ -47,8 +47,8 @@ function Ronin () {
|
||||
this.theme.reset()
|
||||
}
|
||||
|
||||
this.log = function (msg) {
|
||||
console.log(msg)
|
||||
this.log = function (...msg) {
|
||||
console.log(...msg)
|
||||
this.commander.setStatus(msg.reduce((acc, val) => { return acc + val + ' ' }, ''))
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ function Surface (ronin) {
|
||||
const img = new Image()
|
||||
img.src = path
|
||||
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 }
|
||||
this.resize(rect, true)
|
||||
this.context.drawImage(img, 0, 0, img.width, img.height)
|
||||
@ -123,7 +123,7 @@ function Surface (ronin) {
|
||||
this.draw = function (img, rect = this.getFrame()) {
|
||||
return new Promise(resolve => {
|
||||
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)
|
||||
resolve()
|
||||
}
|
||||
@ -131,7 +131,7 @@ function Surface (ronin) {
|
||||
}
|
||||
|
||||
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)
|
||||
this.resize(rect, true)
|
||||
this.context.drawImage(crop, 0, 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user