From c3fb8e05ab1c9ad25a3eaba4183b004a9dea07c0 Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Fri, 8 Jun 2018 16:42:40 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=BE=D0=B7=D0=B2=D1=80=D0=B0=D1=89?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=B8=D0=BB=D0=BE=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=203DPrint=20#8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Applications/3DPrint/Main.lua | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Applications/3DPrint/Main.lua b/Applications/3DPrint/Main.lua index cbc292f5..20a4c947 100644 --- a/Applications/3DPrint/Main.lua +++ b/Applications/3DPrint/Main.lua @@ -402,15 +402,19 @@ view.eventHandler = function(mainContainer, view, e1, e2, e3, e4, e5) elseif e1 == "drop" then touchX, touchY = nil, nil elseif e1 == "scroll" then - currentLayer = currentLayer + e5 - if currentLayer < 0 then - currentLayer = 0 - elseif currentLayer > 15 then - currentLayer = 15 + if e5 > 0 then + if currentLayer < 15 then + currentLayer = currentLayer + 1 + mainContainer:drawOnScreen() + updateOnHologram() + end + else + if currentLayer > 0 then + currentLayer = currentLayer - 1 + mainContainer:drawOnScreen() + updateOnHologram() + end end - - mainContainer:drawOnScreen() - updateOnHologram() elseif e1 == "component_added" or e1 == "component_removed" then updateProxies() end @@ -555,8 +559,8 @@ tintColorSelector.onColorSelected = updateModelFromWidgets -------------------------------------------------------------------------------- -if (args.o or args.open) and args[1] then - load(path) +if (options.o or options.open) and args[1] then + load(args[1]) else newButton.onTouch() end