From 3fb49eb476e8cda4997670d12284911519a9bb3c Mon Sep 17 00:00:00 2001 From: echicken <> Date: Fri, 17 Nov 2017 16:13:24 +0000 Subject: [PATCH] Cosmetic improvements. --- exec/load/progress-bar.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/exec/load/progress-bar.js b/exec/load/progress-bar.js index 563f99c5ab..c6a5ab76d1 100644 --- a/exec/load/progress-bar.js +++ b/exec/load/progress-bar.js @@ -14,7 +14,7 @@ var ProgressBar = function (x, y, w, pframe) { if (typeof w === 'undefined') w = console.screen_columns; var frame = new Frame(x, y, w, 1, this.fg, pframe); - var subframe = new Frame(frame.x + 1, frame.y, frame.width - 2, 1, this.bg|this.fg, frame); + var subframe = new Frame(x + 1, y, 1, 1, this.bg|this.fg, frame); frame.putmsg(format('[%-' + (w - 2) + 's]', '')); this.init = function () { @@ -22,13 +22,12 @@ var ProgressBar = function (x, y, w, pframe) { } this.set_progress = function (percent) { + subframe.width = Math.max(5, Math.floor((w - 2) * (percent * .01))); subframe.clear(); - subframe.width = Math.floor((w - 2) * (percent * .01)); subframe.center(Math.round(percent) + '%'); } this.cycle = function () { - frame.invalidate(); frame.cycle(); } -- GitLab