I'd originally started out with the mental model that the driver prevents things from overlapping, but I haven't done much with that so far. Now I'm resetting my expectations: avoiding overlap is the human's responsibility in this app.
N6R6YJMUEX2DSXVXTHLC65URGKUMYTBPVEGLJDPZCNAW4EFDPP5AC
on.update = function(dt)
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
Viewport.x = Pan.x - App.mouse_x()
Viewport.y = Pan.y - App.mouse_y()
B()
return
end
if Move then
Move.node.x = sx(App.mouse_x())-Move.xoff
Move.node.y = sy(App.mouse_y())-Move.yoff
B()
return
end
end
{"on.key_release":720,"Menu_background_color":611,"Menu_border_color":612,"compute_layout":385,"Menu_command_color":613,"draw_run_time_error":808,"mouse_cursor":558,"draw_menu_bar":641,"Mouse_cursor":559,"add_hotkey_to_menu":616,"survey_animation":827,"Animating":813,"animate_next":809,"num_lines_for_manifest_navigator":676,"reset_manifest_navigator":772,"animate_next_frame":825,"load_from_iterator":670,"on.code_change":820,"order_of_magnitude":573,"manifest_navigator_up":628,"approximate":579,"manifest_navigator_down":635,"font":353,"delete_definition":673,"fw_app":"driver","keychord_press_on_manifest_navigator":765,"Spawn_point":822,"text_input_on_manifest_navigator":634,"from_viewport":823,"scale":712,"interpolate_viewport":824,"Ticks_font":669,"maybe_update_key_in_definitions":529,"manifest_navigator_candidates":638,"on.text_input":834,"add_def_to_menu":640,"B":830,"on.draw":797,"vx":545,"Viewport":604,"update_editor_box":711,"vy":546,"on.mouse_release":721,"on.update":835,"on.keychord_press":828,"tick_spec":660,"Manifest":769,"Page":475,"schema1_of_y":667,"Manifest_navigator":495,"new_definition":821,"line_height":365,"load_definition":716,"Menu_highlight_color":614,"A":831,"y_of_schema1":364,"sy":469,"initialize_editor":678,"on.initialize":807,"box_height":680,"approximate_up":658,"manifest_index":637,"Surface":422,"surface_bounds":814,"on.save_settings":742,"on.code_submit":787,"on.load_settings":782,"get_manifest":768,"Cursor_node":172,"draw_manifest_navigator":677,"Definitions":503,"get_multiple_definitions_from_app":783,"on_handle":547,"initialize_manifest_navigator":773,"move_candidate_to_front_of_manifest":632,"on":1,"load_manifest":694,"on_text":539,"set_mouse_cursor":562,"on.mouse_press":722,"table_and_array_both_empty":689,"draw_cursor":639,"manifest_coord":636,"wait_for_response":781,"sx":544,"fw_parent":834,"get_definition_from_app":784,"add_thick_line":400,"draw_ticks":663,"copy_shape":396}
on.text_input = function(t)
print('text input', t)
if Manifest_navigator.show then
text_input_on_manifest_navigator(t)
elseif Cursor_node then
local old_top = {line=Cursor_node.editor.screen_top1.line, pos=Cursor_node.editor.screen_top1.pos}
local old_definition_name = live.get_cmd_from_buffer(Cursor_node.editor.lines[1].data)
edit.text_input(Cursor_node.editor, t)
if not eq(Cursor_node.editor.screen_top1, old_top) then
Viewport.y = Cursor_node.y + y_of_schema1(Cursor_node.editor, Cursor_node.editor.screen_top1)
end
local definition_name = live.get_cmd_from_buffer(Cursor_node.editor.lines[1].data)
maybe_update_key_in_definitions(old_definition_name, definition_name, Cursor_node)
B(--[[preserve screen_top of cursor node]] true)
end
end
{"on.mouse_release":721,"schema1_of_y":667,"on.update":802,"on.keychord_press":828,"get_multiple_definitions_from_app":783,"on.save_settings":742,"Page":475,"approximate_up":658,"wait_for_response":781,"compute_layout":385,"Ticks_font":669,"table_and_array_both_empty":689,"Manifest_navigator":495,"maybe_update_key_in_definitions":529,"fw_parent":833,"Manifest":769,"font":353,"load_manifest":694,"on_text":539,"on_handle":547,"on.mouse_press":722,"Menu_background_color":611,"A":831,"sx":544,"Definitions":503,"vx":545,"Animating":813,"draw_menu_bar":641,"draw_run_time_error":808,"on.key_release":720,"draw_manifest_navigator":677,"survey_animation":827,"on.code_change":820,"reset_manifest_navigator":772,"mouse_cursor":558,"load_from_iterator":670,"Mouse_cursor":559,"animate_next_frame":825,"add_thick_line":400,"set_mouse_cursor":562,"copy_shape":396,"draw_ticks":663,"draw_cursor":639,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":765,"text_input_on_manifest_navigator":634,"manifest_coord":636,"from_viewport":823,"interpolate_viewport":824,"add_def_to_menu":640,"update_editor_box":711,"manifest_navigator_up":628,"on.load_settings":782,"B":830,"Spawn_point":822,"get_definition_from_app":784,"new_definition":821,"box_height":680,"on.code_submit":787,"fw_app":"driver","Menu_border_color":612,"num_lines_for_manifest_navigator":676,"animate_next":809,"add_hotkey_to_menu":616,"approximate":579,"Menu_highlight_color":614,"on.draw":797,"Menu_command_color":613,"get_manifest":768,"surface_bounds":814,"vy":546,"on.text_input":834,"Surface":422,"line_height":365,"manifest_index":637,"scale":712,"y_of_schema1":364,"manifest_navigator_candidates":638,"on":1,"Viewport":604,"initialize_editor":678,"tick_spec":660,"on.initialize":807,"manifest_navigator_down":635,"order_of_magnitude":573,"load_definition":716,"sy":469,"initialize_manifest_navigator":773,"Cursor_node":172}
on.text_input = function(t)
print('text input', t)
if Manifest_navigator.show then
text_input_on_manifest_navigator(t)
elseif Cursor_node then
local old_top = {line=Cursor_node.editor.screen_top1.line, pos=Cursor_node.editor.screen_top1.pos}
local old_definition_name = live.get_cmd_from_buffer(Cursor_node.editor.lines[1].data)
edit.text_input(Cursor_node.editor, t)
if not eq(Cursor_node.editor.screen_top1, old_top) then
Viewport.y = Cursor_node.y + y_of_schema1(Cursor_node.editor, Cursor_node.editor.screen_top1)
end
local definition_name = live.get_cmd_from_buffer(Cursor_node.editor.lines[1].data)
maybe_update_key_in_definitions(old_definition_name, definition_name, Cursor_node)
-- we need to call A sometimes, but redoing compute_layout on every single character is too much
B(--[[preserve screen_top of cursor node]] true)
end
end
{"on.mouse_release":721,"schema1_of_y":667,"on.update":802,"on.keychord_press":828,"get_multiple_definitions_from_app":783,"on.save_settings":742,"Page":475,"approximate_up":658,"wait_for_response":781,"compute_layout":385,"Ticks_font":669,"table_and_array_both_empty":689,"Manifest_navigator":495,"maybe_update_key_in_definitions":529,"fw_parent":832,"Manifest":769,"font":353,"load_manifest":694,"on_text":539,"on_handle":547,"on.mouse_press":722,"Menu_background_color":611,"A":831,"sx":544,"Definitions":503,"vx":545,"Animating":813,"draw_menu_bar":641,"draw_run_time_error":808,"on.key_release":720,"draw_manifest_navigator":677,"survey_animation":827,"on.code_change":820,"reset_manifest_navigator":772,"mouse_cursor":558,"load_from_iterator":670,"Mouse_cursor":559,"animate_next_frame":825,"add_thick_line":400,"set_mouse_cursor":562,"copy_shape":396,"draw_ticks":663,"draw_cursor":639,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":765,"text_input_on_manifest_navigator":634,"manifest_coord":636,"from_viewport":823,"interpolate_viewport":824,"add_def_to_menu":640,"update_editor_box":711,"manifest_navigator_up":628,"on.load_settings":782,"B":830,"Spawn_point":822,"get_definition_from_app":784,"new_definition":821,"box_height":680,"on.code_submit":787,"fw_app":"driver","Menu_border_color":612,"num_lines_for_manifest_navigator":676,"animate_next":809,"add_hotkey_to_menu":616,"approximate":579,"Menu_highlight_color":614,"on.draw":797,"Menu_command_color":613,"get_manifest":768,"surface_bounds":814,"vy":546,"on.text_input":833,"Surface":422,"line_height":365,"manifest_index":637,"scale":712,"y_of_schema1":364,"manifest_navigator_candidates":638,"on":1,"Viewport":604,"initialize_editor":678,"tick_spec":660,"on.initialize":807,"manifest_navigator_down":635,"order_of_magnitude":573,"load_definition":716,"sy":469,"initialize_manifest_navigator":773,"Cursor_node":172}