pothi.love/0017-on.mouse_release

24 lines
580 B
Plaintext

on.mouse_release = function(x,y, mouse_button)
if Global_state.thread == nil then
-- file picker
-- check for any button clicks
-- compute_layout reuses nodes and so it fills in x,y for us
for _,button in ipairs(Global_state.file_picker) do
if in_rect(button, x,y) then
open_thread(button.data[1].data)
A()
return
end
end
end
if Pan then
-- HACK: shared by file picker and thread view
Pan = nil
A()
elseif Cursor_node then
-- thread view
Cursor_node.show_cursor = true
edit.mouse_release(Cursor_node.editor, x,y, mouse_button)
end
end