pothi.love/0018-on.update

29 lines
640 B
Plaintext
Raw Normal View History

on.update = function(dt)
refresh_debug_animations()
if Animating then
animate_next(dt)
return
end
if Pan then
set_mouse_cursor('hand')
elseif Move or on_handle(App.mouse_x(), App.mouse_y()) then
set_mouse_cursor('crosshair')
else
set_mouse_cursor('arrow')
end
if Pan then
2023-02-19 04:52:12 +00:00
Viewport.x = Pan.x - App.mouse_x()/Viewport.zoom
Viewport.y = Pan.y - App.mouse_y()/Viewport.zoom
B()
return
end
if Move then
Move.node.x = sx(App.mouse_x()-Move.xoff)
Move.node.y = sy(App.mouse_y()-Move.yoff)
-- quantize the x axis to discrete columns
Move.node.x = round(Move.node.x/100)*100
A1(Move.node.key)
return
end
end