The vision is for this to be a little like Expose mode; when in it you can click on a point to zoom in on it (back at the old zoom level).
This is expected to be particularly handy when we start highlighting failing tests.
D2IUVB3LC5R4XQB466K5DJGDPLMPWLZFS63C2PD27DSELWCA2RXQC
snapshot_canvas = function()
-- Render the canvas at pixel perfect resolution.
local winw,winh = App.screen.width, App.screen.height
App.screen.width,App.screen.height = Global_viewport.w, Global_viewport.h
Viewport = copy_viewport(Global_viewport)
Viewport.zoom = 1.0
A()
Canvas = love.graphics.newCanvas(cw,ch)
love.graphics.setCanvas(Canvas)
App.fake_key_press = true -- Hack; disable drawing the menu and ticks
on.draw()
App.fake_key_press = nil
love.graphics.setCanvas()
App.screen.width,App.screen.height = winw,winh
end
{"B":830,"Menu_background_color":611,"vy":546,"Definitions":503,"Menu_command_color":613,"new_definition":848,"box_height":680,"draw_run_time_error":808,"draw_menu_bar":861,"on.mouse_release":836,"add_hotkey_to_menu":616,"on.save_settings":742,"survey_animation":863,"on.keychord_press":871,"animate_next":841,"num_lines_for_manifest_navigator":676,"Page":475,"reset_manifest_navigator":772,"table_and_array_both_empty":689,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"get_definition_from_app":784,"Zoomed_out":869,"manifest_navigator_up":628,"surface_bounds":814,"on.draw":797,"Num_animation_frames":840,"Spawn_point":822,"update_editor_box":711,"on_text":539,"Save_viewport":865,"on.mouse_press":722,"Definition_background_color":849,"Animating":842,"schema1_of_y":667,"vx":545,"scale":712,"definition_background_color":859,"y_of_schema1":364,"on.key_release":720,"copy_viewport":866,"Viewport":604,"mouse_cursor":558,"Mouse_cursor":559,"zoom_out":870,"delete_definition":673,"initialize_editor":678,"set_mouse_cursor":562,"from_viewport":823,"draw_ticks":862,"draw_cursor":639,"sy":469,"move_candidate_to_front_of_manifest":632,"font":353,"keychord_press_on_manifest_navigator":765,"manifest_navigator_down":635,"text_input_on_manifest_navigator":634,"manifest_index":637,"order_of_magnitude":573,"fw_parent":871,"on.code_change":820,"fw_app":"driver","add_thick_line":400,"manifest_navigator_candidates":638,"copy_shape":396,"approximate":579,"add_def_to_menu":640,"draw_manifest_navigator":677,"Test_definition_background_color":858,"snapshot_canvas":872,"manifest_coord":636,"Menu_highlight_color":614,"approximate_up":658,"wait_for_response":781,"Menu_border_color":612,"on.code_submit":787,"Cursor_node":172,"Ticks_font":669,"Manifest_navigator":495,"on":1,"on.initialize":807,"load_definition":854,"sx":544,"initialize_manifest_navigator":773,"on_handle":547,"on.update":835,"interpolate_viewport":843,"tick_spec":660,"line_height":365,"get_multiple_definitions_from_app":783,"on.text_input":855,"animate_next_frame":825,"compute_layout":385,"Manifest":769,"Surface":422,"A":831,"load_manifest":694,"on.load_settings":782,"get_manifest":768}
on.keychord_press = function(chord, key)
print('key', chord)
if Animating then return end
if Move then return end
if Manifest_navigator.reload then
load_manifest()
end
if chord == 'C-=' then
-- zoom in
Viewport.zoom = Viewport.zoom+0.1
B()
elseif chord == 'C--' then
-- zoom out
if (Viewport.zoom-0.1)*20 >= 1 then -- disallow font size of 0
Viewport.zoom = Viewport.zoom-0.1
B()
end
elseif chord == 'C-0' then
-- reset zoom
Viewport.zoom = 1.0
B()
elseif chord == 'C-g' then
-- special 'global zoom' mode
zoom_out()
elseif chord == 'C-q' then
live.send_to_app('QUIT')
elseif Manifest_navigator.show then
keychord_press_on_manifest_navigator(chord, key)
elseif chord == 'C-n' then
new_definition()
A()
elseif chord == 'C-l' then
Manifest_navigator.show = true
Manifest_navigator.for_delete = false
initialize_manifest_navigator()
elseif chord == 'C-d' then
Manifest_navigator.show = true
Manifest_navigator.for_delete = true
initialize_manifest_navigator()
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.keychord_press(Cursor_node.editor, chord, key)
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)
else
if chord == 'up' then
Viewport.y = Viewport.y - scale(20)
B()
elseif chord == 'down' then
Viewport.y = Viewport.y + scale(20)
B()
elseif chord == 'left' then
Viewport.x = Viewport.x - scale(50)
B()
elseif chord == 'right' then
Viewport.x = Viewport.x + scale(50)
B()
elseif chord == 'pageup' then
Viewport.y = Viewport.y - App.screen.height/Viewport.zoom
B()
elseif chord == 'S-up' then
Viewport.y = Viewport.y - App.screen.height/Viewport.zoom
B()
elseif chord == 'pagedown' then
Viewport.y = Viewport.y + App.screen.height/Viewport.zoom
B()
elseif chord == 'S-down' then
Viewport.y = Viewport.y + App.screen.height/Viewport.zoom
B()
elseif chord == 'S-left' then
Viewport.x = Viewport.x - App.screen.width/Viewport.zoom
B()
elseif chord == 'S-right' then
Viewport.x = Viewport.x + App.screen.width/Viewport.zoom
B()
end
end
end
{"B":830,"Menu_background_color":611,"vy":546,"Definitions":503,"Menu_command_color":613,"new_definition":848,"box_height":680,"draw_run_time_error":808,"draw_menu_bar":861,"on.mouse_release":836,"add_hotkey_to_menu":616,"on.save_settings":742,"survey_animation":863,"on.keychord_press":871,"animate_next":841,"num_lines_for_manifest_navigator":676,"Page":475,"reset_manifest_navigator":772,"table_and_array_both_empty":689,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"get_definition_from_app":784,"Zoomed_out":869,"manifest_navigator_up":628,"surface_bounds":814,"on.draw":797,"Num_animation_frames":840,"Spawn_point":822,"update_editor_box":711,"on_text":539,"Save_viewport":865,"on.mouse_press":722,"Definition_background_color":849,"Animating":842,"schema1_of_y":667,"vx":545,"scale":712,"definition_background_color":859,"y_of_schema1":364,"on.key_release":720,"copy_viewport":866,"Viewport":604,"mouse_cursor":558,"Mouse_cursor":559,"zoom_out":870,"delete_definition":673,"initialize_editor":678,"set_mouse_cursor":562,"from_viewport":823,"draw_ticks":862,"draw_cursor":639,"sy":469,"move_candidate_to_front_of_manifest":632,"font":353,"keychord_press_on_manifest_navigator":765,"manifest_navigator_down":635,"text_input_on_manifest_navigator":634,"manifest_index":637,"order_of_magnitude":573,"fw_parent":870,"on.code_change":820,"fw_app":"driver","add_thick_line":400,"manifest_navigator_candidates":638,"copy_shape":396,"approximate":579,"add_def_to_menu":640,"draw_manifest_navigator":677,"Test_definition_background_color":858,"snapshot_canvas":867,"manifest_coord":636,"Menu_highlight_color":614,"approximate_up":658,"wait_for_response":781,"Menu_border_color":612,"on.code_submit":787,"Cursor_node":172,"Ticks_font":669,"Manifest_navigator":495,"on":1,"on.initialize":807,"load_definition":854,"sx":544,"initialize_manifest_navigator":773,"on_handle":547,"on.update":835,"interpolate_viewport":843,"tick_spec":660,"line_height":365,"get_multiple_definitions_from_app":783,"on.text_input":855,"animate_next_frame":825,"compute_layout":385,"Manifest":769,"Surface":422,"A":831,"load_manifest":694,"on.load_settings":782,"get_manifest":768}
zoom_out = function()
Save_viewport = copy_viewport(Viewport)
snapshot_canvas()
Animation = {
Global_viewport,
}
Zoomed_out = true
end
{"B":830,"Menu_background_color":611,"vy":546,"Definitions":503,"Menu_command_color":613,"new_definition":848,"box_height":680,"draw_run_time_error":808,"draw_menu_bar":861,"on.mouse_release":836,"add_hotkey_to_menu":616,"on.save_settings":742,"survey_animation":863,"on.keychord_press":828,"animate_next":841,"num_lines_for_manifest_navigator":676,"Page":475,"reset_manifest_navigator":772,"table_and_array_both_empty":689,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"get_definition_from_app":784,"Zoomed_out":869,"manifest_navigator_up":628,"surface_bounds":814,"on.draw":797,"Num_animation_frames":840,"Spawn_point":822,"update_editor_box":711,"on_text":539,"Save_viewport":865,"on.mouse_press":722,"Definition_background_color":849,"Animating":842,"schema1_of_y":667,"vx":545,"scale":712,"definition_background_color":859,"y_of_schema1":364,"on.key_release":720,"copy_viewport":866,"Viewport":604,"mouse_cursor":558,"Mouse_cursor":559,"zoom_out":870,"delete_definition":673,"initialize_editor":678,"set_mouse_cursor":562,"from_viewport":823,"draw_ticks":862,"draw_cursor":639,"sy":469,"move_candidate_to_front_of_manifest":632,"font":353,"keychord_press_on_manifest_navigator":765,"manifest_navigator_down":635,"text_input_on_manifest_navigator":634,"manifest_index":637,"order_of_magnitude":573,"fw_parent":869,"on.code_change":820,"fw_app":"driver","add_thick_line":400,"manifest_navigator_candidates":638,"copy_shape":396,"approximate":579,"add_def_to_menu":640,"draw_manifest_navigator":677,"Test_definition_background_color":858,"snapshot_canvas":867,"manifest_coord":636,"Menu_highlight_color":614,"approximate_up":658,"wait_for_response":781,"Menu_border_color":612,"on.code_submit":787,"Cursor_node":172,"Ticks_font":669,"Manifest_navigator":495,"on":1,"on.initialize":807,"load_definition":854,"sx":544,"initialize_manifest_navigator":773,"on_handle":547,"on.update":835,"interpolate_viewport":843,"tick_spec":660,"line_height":365,"get_multiple_definitions_from_app":783,"on.text_input":855,"animate_next_frame":825,"compute_layout":385,"Manifest":769,"Surface":422,"A":831,"load_manifest":694,"on.load_settings":782,"get_manifest":768}
{"B":830,"Menu_background_color":611,"vy":546,"Definitions":503,"Menu_command_color":613,"new_definition":848,"box_height":680,"draw_run_time_error":808,"draw_menu_bar":861,"on.mouse_release":836,"add_hotkey_to_menu":616,"on.save_settings":742,"survey_animation":863,"on.keychord_press":828,"animate_next":841,"num_lines_for_manifest_navigator":676,"Page":475,"reset_manifest_navigator":772,"table_and_array_both_empty":689,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"get_definition_from_app":784,"Zoomed_out":869,"manifest_navigator_up":628,"surface_bounds":814,"on.draw":797,"Num_animation_frames":840,"Spawn_point":822,"update_editor_box":711,"on_text":539,"Save_viewport":865,"on.mouse_press":722,"Definition_background_color":849,"Animating":842,"schema1_of_y":667,"vx":545,"scale":712,"definition_background_color":859,"y_of_schema1":364,"on.key_release":720,"copy_viewport":866,"Viewport":604,"mouse_cursor":558,"Mouse_cursor":559,"zoom_out":868,"delete_definition":673,"initialize_editor":678,"set_mouse_cursor":562,"from_viewport":823,"draw_ticks":862,"draw_cursor":639,"sy":469,"move_candidate_to_front_of_manifest":632,"font":353,"keychord_press_on_manifest_navigator":765,"manifest_navigator_down":635,"text_input_on_manifest_navigator":634,"manifest_index":637,"order_of_magnitude":573,"fw_parent":868,"on.code_change":820,"fw_app":"driver","add_thick_line":400,"manifest_navigator_candidates":638,"copy_shape":396,"approximate":579,"add_def_to_menu":640,"draw_manifest_navigator":677,"Test_definition_background_color":858,"snapshot_canvas":867,"manifest_coord":636,"Menu_highlight_color":614,"approximate_up":658,"wait_for_response":781,"Menu_border_color":612,"on.code_submit":787,"Cursor_node":172,"Ticks_font":669,"Manifest_navigator":495,"on":1,"on.initialize":807,"load_definition":854,"sx":544,"initialize_manifest_navigator":773,"on_handle":547,"on.update":835,"interpolate_viewport":843,"tick_spec":660,"line_height":365,"get_multiple_definitions_from_app":783,"on.text_input":855,"animate_next_frame":825,"compute_layout":385,"Manifest":769,"Surface":422,"A":831,"load_manifest":694,"on.load_settings":782,"get_manifest":768}
Zoomed_out = nil -- special mode when set
zoom_out = function()
Save_viewport = copy_viewport(Viewport)
snapshot_canvas()
Animation = {
Global_viewport,
}
end
{"B":830,"Menu_background_color":611,"vy":546,"Definitions":503,"Menu_command_color":613,"new_definition":848,"box_height":680,"draw_run_time_error":808,"draw_menu_bar":861,"on.mouse_release":836,"add_hotkey_to_menu":616,"on.save_settings":742,"survey_animation":863,"on.keychord_press":828,"animate_next":841,"num_lines_for_manifest_navigator":676,"Page":475,"reset_manifest_navigator":772,"table_and_array_both_empty":689,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"get_definition_from_app":784,"manifest_navigator_up":628,"surface_bounds":814,"on.draw":797,"Num_animation_frames":840,"Spawn_point":822,"update_editor_box":711,"on_text":539,"Save_viewport":865,"on.mouse_press":722,"Definition_background_color":849,"Animating":842,"schema1_of_y":667,"vx":545,"scale":712,"definition_background_color":859,"y_of_schema1":364,"on.key_release":720,"copy_viewport":866,"Viewport":604,"mouse_cursor":558,"Mouse_cursor":559,"zoom_out":868,"delete_definition":673,"initialize_editor":678,"set_mouse_cursor":562,"from_viewport":823,"draw_ticks":862,"draw_cursor":639,"sy":469,"move_candidate_to_front_of_manifest":632,"font":353,"keychord_press_on_manifest_navigator":765,"manifest_navigator_down":635,"text_input_on_manifest_navigator":634,"manifest_index":637,"order_of_magnitude":573,"fw_parent":867,"on.code_change":820,"fw_app":"driver","add_thick_line":400,"manifest_navigator_candidates":638,"copy_shape":396,"approximate":579,"add_def_to_menu":640,"draw_manifest_navigator":677,"Test_definition_background_color":858,"snapshot_canvas":867,"manifest_coord":636,"Menu_highlight_color":614,"approximate_up":658,"wait_for_response":781,"Menu_border_color":612,"on.code_submit":787,"Cursor_node":172,"Ticks_font":669,"Manifest_navigator":495,"on":1,"on.initialize":807,"load_definition":854,"sx":544,"initialize_manifest_navigator":773,"on_handle":547,"on.update":835,"interpolate_viewport":843,"tick_spec":660,"line_height":365,"get_multiple_definitions_from_app":783,"on.text_input":855,"animate_next_frame":825,"compute_layout":385,"Manifest":769,"Surface":422,"A":831,"load_manifest":694,"on.load_settings":782,"get_manifest":768}
snapshot_canvas = function()
-- Render the canvas at pixel perfect resolution.
local winw,winh = App.screen.width, App.screen.height
App.screen.width,App.screen.height = Global_viewport.w, Global_viewport.h
Viewport = copy_viewport(Global_viewport)
Vieport.zoom = 1.0
A()
Canvas = love.graphics.newCanvas(cw,ch)
love.graphics.setCanvas(Canvas)
App.fake_key_press = true -- Hack; disable drawing the menu and ticks
on.draw()
App.fake_key_press = nil
love.graphics.setCanvas()
App.screen.width,App.screen.height = winw,winh
end
{"B":830,"Menu_background_color":611,"vy":546,"Definitions":503,"Menu_command_color":613,"new_definition":848,"box_height":680,"draw_run_time_error":808,"draw_menu_bar":861,"on.mouse_release":836,"add_hotkey_to_menu":616,"on.save_settings":742,"survey_animation":863,"on.keychord_press":828,"animate_next":841,"num_lines_for_manifest_navigator":676,"Page":475,"reset_manifest_navigator":772,"table_and_array_both_empty":689,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"get_definition_from_app":784,"manifest_navigator_up":628,"surface_bounds":814,"on.draw":797,"Num_animation_frames":840,"Spawn_point":822,"update_editor_box":711,"on_text":539,"Save_viewport":865,"on.mouse_press":722,"Definition_background_color":849,"Animating":842,"schema1_of_y":667,"vx":545,"scale":712,"definition_background_color":859,"y_of_schema1":364,"on.key_release":720,"copy_viewport":866,"Viewport":604,"mouse_cursor":558,"Mouse_cursor":559,"delete_definition":673,"initialize_editor":678,"set_mouse_cursor":562,"from_viewport":823,"draw_ticks":862,"draw_cursor":639,"sy":469,"move_candidate_to_front_of_manifest":632,"font":353,"keychord_press_on_manifest_navigator":765,"manifest_navigator_down":635,"text_input_on_manifest_navigator":634,"manifest_index":637,"order_of_magnitude":573,"fw_parent":866,"on.code_change":820,"fw_app":"driver","add_thick_line":400,"manifest_navigator_candidates":638,"copy_shape":396,"approximate":579,"add_def_to_menu":640,"draw_manifest_navigator":677,"Test_definition_background_color":858,"snapshot_canvas":867,"manifest_coord":636,"Menu_highlight_color":614,"approximate_up":658,"wait_for_response":781,"Menu_border_color":612,"on.code_submit":787,"Cursor_node":172,"Ticks_font":669,"Manifest_navigator":495,"on":1,"on.initialize":807,"load_definition":854,"sx":544,"initialize_manifest_navigator":773,"on_handle":547,"on.update":835,"interpolate_viewport":843,"tick_spec":660,"line_height":365,"get_multiple_definitions_from_app":783,"on.text_input":855,"animate_next_frame":825,"compute_layout":385,"Manifest":769,"Surface":422,"A":831,"load_manifest":694,"on.load_settings":782,"get_manifest":768}
{"B":830,"Menu_background_color":611,"vy":546,"Definitions":503,"Menu_command_color":613,"new_definition":848,"box_height":680,"draw_run_time_error":808,"draw_menu_bar":861,"on.mouse_release":836,"add_hotkey_to_menu":616,"on.save_settings":742,"survey_animation":863,"on.keychord_press":828,"animate_next":841,"num_lines_for_manifest_navigator":676,"Page":475,"reset_manifest_navigator":772,"table_and_array_both_empty":689,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"get_definition_from_app":784,"manifest_navigator_up":628,"surface_bounds":814,"on.draw":797,"Num_animation_frames":840,"Spawn_point":822,"update_editor_box":711,"on_text":539,"Save_viewport":865,"on.mouse_press":722,"Definition_background_color":849,"Animating":842,"schema1_of_y":667,"vx":545,"scale":712,"definition_background_color":859,"y_of_schema1":364,"on.key_release":720,"copy_viewport":866,"Viewport":604,"mouse_cursor":558,"Mouse_cursor":559,"delete_definition":673,"initialize_editor":678,"set_mouse_cursor":562,"from_viewport":823,"draw_ticks":862,"draw_cursor":639,"sy":469,"move_candidate_to_front_of_manifest":632,"font":353,"keychord_press_on_manifest_navigator":765,"manifest_navigator_down":635,"text_input_on_manifest_navigator":634,"manifest_index":637,"order_of_magnitude":573,"fw_parent":865,"on.code_change":820,"fw_app":"driver","add_thick_line":400,"manifest_navigator_candidates":638,"copy_shape":396,"approximate":579,"add_def_to_menu":640,"draw_manifest_navigator":677,"Test_definition_background_color":858,"snapshot_canvas":864,"manifest_coord":636,"Menu_highlight_color":614,"approximate_up":658,"wait_for_response":781,"Menu_border_color":612,"on.code_submit":787,"Cursor_node":172,"Ticks_font":669,"Manifest_navigator":495,"on":1,"on.initialize":807,"load_definition":854,"sx":544,"initialize_manifest_navigator":773,"on_handle":547,"on.update":835,"interpolate_viewport":843,"tick_spec":660,"line_height":365,"get_multiple_definitions_from_app":783,"on.text_input":855,"animate_next_frame":825,"compute_layout":385,"Manifest":769,"Surface":422,"A":831,"load_manifest":694,"on.load_settings":782,"get_manifest":768}
copy_viewport = function(v)
return {x=v.x, y=v.y, w=v.w, h=v.h, zoom=v.zoom}
end
{"B":830,"Menu_background_color":611,"vy":546,"Definitions":503,"Menu_command_color":613,"new_definition":848,"box_height":680,"draw_run_time_error":808,"draw_menu_bar":861,"on.mouse_release":836,"add_hotkey_to_menu":616,"on.save_settings":742,"survey_animation":863,"on.keychord_press":828,"animate_next":841,"num_lines_for_manifest_navigator":676,"Page":475,"reset_manifest_navigator":772,"table_and_array_both_empty":689,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"get_definition_from_app":784,"manifest_navigator_up":628,"surface_bounds":814,"on.draw":797,"Num_animation_frames":840,"Spawn_point":822,"update_editor_box":711,"on_text":539,"Save_viewport":865,"on.mouse_press":722,"Definition_background_color":849,"Animating":842,"schema1_of_y":667,"vx":545,"scale":712,"definition_background_color":859,"y_of_schema1":364,"on.key_release":720,"Viewport":604,"mouse_cursor":558,"Mouse_cursor":559,"delete_definition":673,"initialize_editor":678,"set_mouse_cursor":562,"from_viewport":823,"draw_ticks":862,"draw_cursor":639,"sy":469,"move_candidate_to_front_of_manifest":632,"font":353,"keychord_press_on_manifest_navigator":765,"manifest_navigator_down":635,"text_input_on_manifest_navigator":634,"manifest_index":637,"order_of_magnitude":573,"fw_parent":864,"on.code_change":820,"fw_app":"driver","add_thick_line":400,"manifest_navigator_candidates":638,"copy_shape":396,"approximate":579,"add_def_to_menu":640,"draw_manifest_navigator":677,"Test_definition_background_color":858,"snapshot_canvas":864,"manifest_coord":636,"Menu_highlight_color":614,"approximate_up":658,"wait_for_response":781,"Menu_border_color":612,"on.code_submit":787,"Cursor_node":172,"Ticks_font":669,"Manifest_navigator":495,"on":1,"on.initialize":807,"load_definition":854,"sx":544,"initialize_manifest_navigator":773,"on_handle":547,"on.update":835,"interpolate_viewport":843,"tick_spec":660,"line_height":365,"get_multiple_definitions_from_app":783,"on.text_input":855,"animate_next_frame":825,"compute_layout":385,"Manifest":769,"Surface":422,"A":831,"load_manifest":694,"on.load_settings":782,"get_manifest":768}
Save_viewport = nil -- save one previous position sometimes