We're now keeping App.run_tests around.
BCMRXDVBMOVHT3S4JJXVFYUVYCVKSR7374O3SV3K74QMCXSVUEBQC
{"Ticks_font":669,"new_definition":848,"table_and_array_both_empty":689,"draw_run_time_error":808,"maybe_update_key_in_definitions":529,"y_of_schema1":364,"animate_next":841,"Menu_background_color":611,"Menu_border_color":612,"animate_next_frame":825,"Menu_command_color":613,"vx":545,"Menu_highlight_color":614,"Viewport":604,"draw_menu_bar":861,"vy":546,"surface_bounds":814,"Cursor_node":172,"num_lines_for_manifest_navigator":676,"on.mouse_release":836,"reset_manifest_navigator":772,"load_from_iterator":670,"Spawn_point":822,"get_definition_from_app":784,"from_viewport":823,"Page":475,"interpolate_viewport":843,"add_thick_line":400,"manifest_navigator_up":628,"copy_shape":396,"manifest_navigator_down":635,"Animating":842,"B":830,"Num_animation_frames":840,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":765,"on_handle":547,"text_input_on_manifest_navigator":634,"A":831,"on":1,"on.code_change":820,"manifest_index":637,"on.mouse_press":722,"manifest_navigator_candidates":638,"on.update":835,"sx":544,"on.draw":797,"scale":712,"manifest_coord":636,"on.key_release":720,"fw_parent":861,"wait_for_response":781,"Surface":422,"sy":469,"compute_layout":385,"get_multiple_definitions_from_app":783,"initialize_manifest_navigator":773,"delete_definition":673,"mouse_cursor":558,"Definitions":503,"Mouse_cursor":559,"tick_spec":660,"font":353,"fw_app":"driver","set_mouse_cursor":562,"Manifest_navigator":495,"draw_ticks":862,"line_height":365,"on.initialize":807,"on.code_submit":787,"initialize_editor":678,"on.text_input":855,"survey_animation":860,"on_text":539,"approximate_up":658,"order_of_magnitude":573,"load_definition":854,"add_hotkey_to_menu":616,"draw_manifest_navigator":677,"on.keychord_press":828,"approximate":579,"Manifest":769,"update_editor_box":711,"box_height":680,"load_manifest":694,"definition_background_color":859,"get_manifest":768,"Test_definition_background_color":858,"on.save_settings":742,"schema1_of_y":667,"on.load_settings":782,"Definition_background_color":849,"add_def_to_menu":640,"draw_cursor":639}
draw_ticks = function()
if App.fake_key_press then return end -- disable in tests
local old_font = love.graphics.getFont()
love.graphics.setFont(Ticks_font)
love.graphics.setColor(0.6,0.6,0.6)
-- x axis
local anchorlo, anchorhi, scale = tick_spec(Viewport.x, sx(App.screen.width))
for x=anchorlo,anchorhi,scale do
local vx = vx(x)
love.graphics.line(vx, Menu_bar_height, vx, Menu_bar_height+5)
love.graphics.print(('%2.0f'):format(x), vx+2, Menu_bar_height+5)
love.graphics.line(vx, App.screen.height, vx, App.screen.height-5)
love.graphics.print(('%2.0f'):format(x), vx+2, App.screen.height-15)
end
-- y axis
local anchorlo, anchorhi, scale = tick_spec(Viewport.y, sy(App.screen.height))
for y=anchorlo,anchorhi,scale do
local vy = vy(y)
love.graphics.line(0, vy, 5, vy)
love.graphics.print(('%2.0f'):format(y), 5, vy+2)
love.graphics.line(App.screen.width, vy, App.screen.width-5, vy)
love.graphics.print(('%2.0f'):format(y), App.screen.width-20, vy+2)
end
love.graphics.setFont(old_font)
end
{"Ticks_font":669,"new_definition":848,"table_and_array_both_empty":689,"draw_run_time_error":808,"maybe_update_key_in_definitions":529,"y_of_schema1":364,"animate_next":841,"Menu_background_color":611,"Menu_border_color":612,"animate_next_frame":825,"Menu_command_color":613,"vx":545,"Menu_highlight_color":614,"Viewport":604,"draw_menu_bar":861,"vy":546,"surface_bounds":814,"Cursor_node":172,"num_lines_for_manifest_navigator":676,"on.mouse_release":836,"reset_manifest_navigator":772,"load_from_iterator":670,"Spawn_point":822,"get_definition_from_app":784,"from_viewport":823,"Page":475,"interpolate_viewport":843,"add_thick_line":400,"manifest_navigator_up":628,"copy_shape":396,"manifest_navigator_down":635,"Animating":842,"B":830,"Num_animation_frames":840,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":765,"on_handle":547,"text_input_on_manifest_navigator":634,"A":831,"on":1,"on.code_change":820,"manifest_index":637,"on.mouse_press":722,"manifest_navigator_candidates":638,"on.update":835,"sx":544,"on.draw":797,"scale":712,"manifest_coord":636,"on.key_release":720,"fw_parent":860,"wait_for_response":781,"Surface":422,"sy":469,"compute_layout":385,"get_multiple_definitions_from_app":783,"initialize_manifest_navigator":773,"delete_definition":673,"mouse_cursor":558,"Definitions":503,"Mouse_cursor":559,"tick_spec":660,"font":353,"fw_app":"driver","set_mouse_cursor":562,"Manifest_navigator":495,"draw_ticks":844,"line_height":365,"on.initialize":807,"on.code_submit":787,"initialize_editor":678,"on.text_input":855,"survey_animation":860,"on_text":539,"approximate_up":658,"order_of_magnitude":573,"load_definition":854,"add_hotkey_to_menu":616,"draw_manifest_navigator":677,"on.keychord_press":828,"approximate":579,"Manifest":769,"update_editor_box":711,"box_height":680,"load_manifest":694,"definition_background_color":859,"get_manifest":768,"Test_definition_background_color":858,"on.save_settings":742,"schema1_of_y":667,"on.load_settings":782,"Definition_background_color":849,"add_def_to_menu":640,"draw_cursor":639}
draw_menu_bar = function()
if App.fake_key_press then return end -- disable in tests
App.color(Menu_background_color)
love.graphics.rectangle('fill', 0,0, App.screen.width, Menu_bar_height)
App.color(Menu_border_color)
love.graphics.rectangle('line', 0,0, App.screen.width, Menu_bar_height)
App.color(Menu_command_color)
Menu_cursor = 5
if Manifest_navigator.show then
draw_manifest_navigator()
return
end
add_hotkey_to_menu('ctrl+l: load definition')
add_hotkey_to_menu('ctrl+n: new definition')
add_hotkey_to_menu('ctrl+d: delete definition')
add_hotkey_to_menu('ctrl+f: find')
add_hotkey_to_menu('ctrl+left ctrl+right: prev/next word')
add_hotkey_to_menu('ctrl+z ctrl+y: undo/redo')
add_hotkey_to_menu('ctrl+x ctrl+c ctrl+v: cut/copy/paste')
add_hotkey_to_menu('ctrl+= ctrl+- ctrl+0: zoom')
end
survey_animation = function()
---[[ '--' at start to disable animation, '---' to enable
local minx, miny, maxx, maxy = surface_bounds(Definitions)
-- ensure 1px of white background all around
-- just in case the viewport ever goes
-- outside canvas bounds while animating
minx,miny, maxx,maxy = minx-1,miny-1, maxx+1,maxx+1
local zoomx = App.screen.width/(maxx-minx)
local zoomy = App.screen.height/(maxy-miny)
local zoom, cw, ch
if zoomx < zoomy then
zoom = zoomx
cw = maxx-minx
ch = cw*App.screen.height/App.screen.width
else
zoom = zoomy
ch = maxy-miny
cw = ch*App.screen.width/App.screen.height
end
local desired_viewport = Viewport
Global_viewport = {x=minx, y=miny, w=cw, h=ch, zoom=zoom}
-- 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 = {x=minx, y=miny, w=cw, h=ch, 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
-- initialize animation
Animating = {
Global_viewport,
desired_viewport,
}
Viewport.x = -App.screen.width/2
Viewport.y = -App.screen.height/2
Viewport.w = App.screen.width
Viewport.h = App.screen.height
Viewport.zoom = 1.0 --]]
end
{"Ticks_font":669,"new_definition":848,"table_and_array_both_empty":689,"draw_run_time_error":808,"maybe_update_key_in_definitions":529,"y_of_schema1":364,"animate_next":841,"Menu_background_color":611,"Menu_border_color":612,"animate_next_frame":825,"Menu_command_color":613,"vx":545,"Menu_highlight_color":614,"Viewport":604,"draw_menu_bar":641,"vy":546,"surface_bounds":814,"Cursor_node":172,"num_lines_for_manifest_navigator":676,"on.mouse_release":836,"reset_manifest_navigator":772,"load_from_iterator":670,"Spawn_point":822,"get_definition_from_app":784,"from_viewport":823,"Page":475,"interpolate_viewport":843,"add_thick_line":400,"manifest_navigator_up":628,"copy_shape":396,"manifest_navigator_down":635,"Animating":842,"B":830,"Num_animation_frames":840,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":765,"on_handle":547,"text_input_on_manifest_navigator":634,"A":831,"on":1,"on.code_change":820,"manifest_index":637,"on.mouse_press":722,"manifest_navigator_candidates":638,"on.update":835,"sx":544,"on.draw":797,"scale":712,"manifest_coord":636,"on.key_release":720,"fw_parent":861,"wait_for_response":781,"Surface":422,"sy":469,"compute_layout":385,"get_multiple_definitions_from_app":783,"initialize_manifest_navigator":773,"delete_definition":673,"mouse_cursor":558,"Definitions":503,"Mouse_cursor":559,"tick_spec":660,"font":353,"fw_app":"driver","set_mouse_cursor":562,"Manifest_navigator":495,"draw_ticks":844,"line_height":365,"on.initialize":807,"on.code_submit":787,"initialize_editor":678,"on.text_input":855,"survey_animation":860,"on_text":539,"approximate_up":658,"order_of_magnitude":573,"load_definition":854,"add_hotkey_to_menu":616,"draw_manifest_navigator":677,"on.keychord_press":828,"approximate":579,"Manifest":769,"update_editor_box":711,"box_height":680,"load_manifest":694,"definition_background_color":859,"get_manifest":768,"Test_definition_background_color":858,"on.save_settings":742,"schema1_of_y":667,"on.load_settings":782,"Definition_background_color":849,"add_def_to_menu":640,"draw_cursor":639}