From c0c276ea318e78b3ed4adb53e996f4880e217dae Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Thu, 10 Aug 2017 09:56:37 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=D0=B0=20=D1=80?= =?UTF-8?q?=D0=B0=D0=BC=D0=BA=D0=B0=20=D1=81=20GUI.treeView?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Applications.cfg | 2 +- lib/GUI.lua | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Applications.cfg b/Applications.cfg index 82e1ea25..9ac90dac 100644 --- a/Applications.cfg +++ b/Applications.cfg @@ -301,7 +301,7 @@ url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/lib/GUI.lua", type="Library", preloadFile=true, - version=1.66, + version=1.67, }, { path="/lib/rayEngine.lua", diff --git a/lib/GUI.lua b/lib/GUI.lua index 9a1489a5..8886e800 100755 --- a/lib/GUI.lua +++ b/lib/GUI.lua @@ -1190,7 +1190,7 @@ local function treeViewUpdateFileList(treeView) end local function treeViewDraw(treeView) - local y = treeView.y + 1 + local y = treeView.y local showScrollBar = #treeView.fileList > treeView.height local textLimit = treeView.width - (showScrollBar and 2 or 1) @@ -1213,7 +1213,9 @@ local function treeViewDraw(treeView) end y = y + 1 - if y > treeView.y + treeView.height - 2 then break end + if y > treeView.y + treeView.height - 1 then + break + end end if showScrollBar then @@ -1237,7 +1239,7 @@ end local function treeViewEventHandler(mainContainer, object, eventData) if eventData[1] == "touch" then - local fileIndex = eventData[4] - object.y + object.fromFile - 1 + local fileIndex = eventData[4] - object.y + object.fromFile if object.fileList[fileIndex] then if object.fileList[fileIndex].isDirectory then if object.directoriesToShowContent[object.fileList[fileIndex].path] then