pothi.love/0179-on.mouse_press

13 lines
292 B
Plaintext

on.mouse_press = function(x,y, mouse_button)
if Cursor_node then
Cursor_node.show_cursor = nil
Cursor_node = nil
end
local node = to_text(x,y)
if node then
Cursor_node = node
edit.mouse_pressed(node.editor, x,y, mouse_button)
else
Pan = {x=Viewport.x+x,y=Viewport.y+y}
end
end