Resize on open

This commit is contained in:
Devine Lu Linvega 2019-08-04 07:11:48 +09:00
parent 6a78757139
commit 9e8e0597c4

View File

@ -173,7 +173,7 @@ function Surface (ronin) {
img.src = path img.src = path
img.onload = () => { img.onload = () => {
const rect = { x: 0, y: 0, w: img.width * ratio, h: img.height * ratio } const rect = { x: 0, y: 0, w: img.width * ratio, h: img.height * ratio }
this.resize(rect) this.resize(rect,true)
this.context.drawImage(img, rect.x, rect.y, rect.w, rect.h) this.context.drawImage(img, rect.x, rect.y, rect.w, rect.h)
resolve() resolve()
} }