Display file size in terface
This commit is contained in:
@@ -82,7 +82,8 @@ function Commander (ronin) {
|
||||
// console.log(msg)
|
||||
}
|
||||
// Source
|
||||
const _source = `${ronin.source}[${this._input.value.split('\n').length}]`
|
||||
const rect = ronin.surface.getFrame()
|
||||
const _source = `${ronin.source}[${this._input.value.split('\n').length}]\n${rect.w}x${rect.h}`
|
||||
if (_source !== this._source.textContent) {
|
||||
this._source.textContent = _source
|
||||
}
|
||||
|
||||
@@ -137,7 +137,6 @@ function Surface (ronin) {
|
||||
img.src = path
|
||||
img.onload = () => {
|
||||
const rect = { x: 0, y: 0, w: parseInt(img.width * ratio), h: parseInt(img.height * ratio) }
|
||||
ronin.log(`Open ${rect.w}x${rect.h}`)
|
||||
this.resize(rect, true)
|
||||
this.context.drawImage(img, 0, 0, rect.w, rect.h)
|
||||
resolve()
|
||||
@@ -148,7 +147,6 @@ function Surface (ronin) {
|
||||
this.draw = function (img, shape = this.getFrame()) {
|
||||
return new Promise(resolve => {
|
||||
img.onload = () => {
|
||||
ronin.log(`Draw ${img.width}x${img.height}`)
|
||||
if (isLine(shape)) {
|
||||
this.context.drawImage(img, shape.a.x, shape.a.y, shape.b.x - shape.a.x, shape.b.y - shape.a.y)
|
||||
} else if (isRect(shape)) {
|
||||
|
||||
Reference in New Issue
Block a user