Resize on open
This commit is contained in:
parent
6a78757139
commit
9e8e0597c4
@ -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()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user