pothi.love/0006-on.mouse_press

17 lines
393 B
Plaintext
Raw Normal View History

2022-12-24 04:39:54 +00:00
on.mouse_press = function(x,y, mouse_button)
2023-10-22 19:41:34 +01:00
print('mouse press', x,y)
2022-12-18 02:32:18 +00:00
if Cursor_node then
Cursor_node.show_cursor = nil
Cursor_node = nil
end
local node = to_text(x,y)
if node then
-- position cursor in node
2022-12-18 02:32:18 +00:00
Cursor_node = node
2022-12-24 06:35:21 +00:00
edit.mouse_press(node.editor, x,y, mouse_button)
return
2022-12-18 02:32:18 +00:00
end
-- pan surface
Pan = {x=Viewport.x+x/Viewport.zoom,y=Viewport.y+y/Viewport.zoom}
2022-12-24 06:35:21 +00:00
end