mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2025-12-20 11:09:21 +01:00
Ну, скролл всяко лишним не будет
This commit is contained in:
parent
50bedb4ea5
commit
c76ac95a28
@ -778,11 +778,19 @@ end
|
|||||||
local jog = window:addChild(GUI.object(15, 20, 52, 26))
|
local jog = window:addChild(GUI.object(15, 20, 52, 26))
|
||||||
local jogAngleOld
|
local jogAngleOld
|
||||||
|
|
||||||
jog.eventHandler = function(workspace, jog, e1, e2, e3, e4, ...)
|
jog.eventHandler = function(workspace, jog, e1, e2, e3, e4, e5, ...)
|
||||||
if not tape or not powerButton.pressed then
|
if not tape or not powerButton.pressed then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function jogNavigate(direction)
|
||||||
|
incrementJogIndex(direction)
|
||||||
|
invalidateJogIncrementUptime(computer.uptime())
|
||||||
|
workspace:draw()
|
||||||
|
|
||||||
|
navigate(direction)
|
||||||
|
end
|
||||||
|
|
||||||
if e1 == "drag" then
|
if e1 == "drag" then
|
||||||
local angleNew = math.atan2(
|
local angleNew = math.atan2(
|
||||||
e3 - jog.x - jog.width / 2,
|
e3 - jog.x - jog.width / 2,
|
||||||
@ -790,19 +798,16 @@ jog.eventHandler = function(workspace, jog, e1, e2, e3, e4, ...)
|
|||||||
)
|
)
|
||||||
|
|
||||||
if jogAngleOld then
|
if jogAngleOld then
|
||||||
local direction = jogAngleOld - angleNew >= 0 and 1 or -1
|
jogNavigate(jogAngleOld - angleNew >= 0 and 1 or -1)
|
||||||
|
|
||||||
incrementJogIndex(direction)
|
|
||||||
invalidateJogIncrementUptime(computer.uptime())
|
|
||||||
navigate(direction)
|
|
||||||
|
|
||||||
workspace:draw()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
jogAngleOld = angleNew
|
jogAngleOld = angleNew
|
||||||
|
|
||||||
elseif e1 == "drop" then
|
elseif e1 == "drop" then
|
||||||
jogAngleOld = nil
|
jogAngleOld = nil
|
||||||
|
|
||||||
|
elseif e1 == "scroll" then
|
||||||
|
jogNavigate(e5 >= 0 and 1 or -1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user