From 2be2e8861c7e0070a0c6abecc2c8bfe32e116e37 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 28 Jul 2019 09:31:05 +0900 Subject: [PATCH] Display file size in terface --- desktop/sources/links/main.css | 2 +- desktop/sources/scripts/commander.js | 3 ++- desktop/sources/scripts/surface.js | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/desktop/sources/links/main.css b/desktop/sources/links/main.css index 61c91f1..94a2985 100644 --- a/desktop/sources/links/main.css +++ b/desktop/sources/links/main.css @@ -7,7 +7,7 @@ body { margin:0px; padding:0px; overflow:hidden; font-family:"input_mono_regular #ronin #wrapper #commander { z-index: 9000;position: relative;width: calc(50vw - 30px);height: calc(100vh - 60px);-webkit-app-region: no-drag;padding-right: 30px;transition: margin-left 250ms;} #ronin #wrapper #commander textarea { background: none; width: 100%; height: calc(100vh - 105px); resize: none; font-size: 12px;line-height: 15px; padding-right: 15px} #ronin #wrapper #commander #status { position: absolute; bottom: 0px; text-transform: lowercase; line-height: 15px; height: 30px; overflow: hidden; width: calc(100% - 30px);} -#ronin #wrapper #commander #source { position: absolute;right: 0px;bottom: 0px; } +#ronin #wrapper #commander #status #source { position: absolute;right: 0px;bottom: 0px; white-space: pre} #ronin.expand #wrapper #commander { width:100%; } #ronin #surface,#ronin #guide { position: absolute; top:0px; -webkit-user-select: none;-webkit-app-region: no-drag; background-image: url("data:image/svg+xml;utf8,"); background-size: 10px 10px; background-position: -4px -4px; width:100%; height:100%; transition: left 250ms} diff --git a/desktop/sources/scripts/commander.js b/desktop/sources/scripts/commander.js index 5a5f704..2914037 100644 --- a/desktop/sources/scripts/commander.js +++ b/desktop/sources/scripts/commander.js @@ -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 } diff --git a/desktop/sources/scripts/surface.js b/desktop/sources/scripts/surface.js index 9f19196..cf5c69e 100644 --- a/desktop/sources/scripts/surface.js +++ b/desktop/sources/scripts/surface.js @@ -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)) {