From 833c1eb40656bb92cdde6543fae11d9e518b95d5 Mon Sep 17 00:00:00 2001 From: igor Date: Sat, 6 Jan 2018 12:49:29 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B3=D1=80=D0=B5=D1=81?= =?UTF-8?q?=D1=81=D0=B1=D0=B0=D1=80-=D1=84=D0=B8=D1=87=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Applications.cfg | 2 +- lib/GUI.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Applications.cfg b/Applications.cfg index 6e56b866..919b19c7 100644 --- a/Applications.cfg +++ b/Applications.cfg @@ -319,7 +319,7 @@ url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/lib/GUI.lua", type="Library", preloadFile=true, - version=2.08, + version=2.09, }, { path="/lib/rayEngine.lua", diff --git a/lib/GUI.lua b/lib/GUI.lua index 4a8a8c66..8bb449de 100755 --- a/lib/GUI.lua +++ b/lib/GUI.lua @@ -797,7 +797,7 @@ end ----------------------------------------- ProgressBar Object ----------------------------------------- local function drawProgressBar(object) - local activeWidth = math.floor(object.value * object.width / 100) + local activeWidth = math.floor(math.min(object.value, 100) / 100 * object.width) if object.thin then buffer.text(object.x, object.y, object.colors.passive, string.rep("━", object.width)) buffer.text(object.x, object.y, object.colors.active, string.rep("━", activeWidth)) @@ -807,7 +807,7 @@ local function drawProgressBar(object) end if object.showValue then - local stringValue = tostring((object.valuePrefix or "") .. object.value .. (object.valuePostfix or "")) + local stringValue = (object.valuePrefix or "") .. object.value .. (object.valuePostfix or "") buffer.text(math.floor(object.x + object.width / 2 - unicode.len(stringValue) / 2), object.y + 1, object.colors.value, stringValue) end