UHQQZ6T4AAORLMRQIPHW6DHKTMLS6P45E44RCU5K654IO7PRFMTQC
on.keychord_press = function(chord, key)
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
A()
elseif chord == 'C--' then
-- zoom out
Viewport.zoom = Viewport.zoom-0.1
A()
elseif chord == 'C-0' then
-- reset zoom
Viewport.zoom = 1.0
A()
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()
elseif chord == 'C-l' then
Manifest_navigator.show = true
Manifest_navigator.for_delete = false
elseif chord == 'C-d' then
Manifest_navigator.show = true
Manifest_navigator.for_delete = true
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)
A(--[[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
{"Manifest":494,"maybe_update_key_in_definitions":529,"on_handle":547,"scale":7,"on_text":539,"on.mouse_press":556,"box_height":345,"on.initialize":506,"compute_layout":385,"vx":545,"line_height":365,"on.code_change":306,"on":1,"on.key_release":552,"sy":469,"Surface":422,"A":507,"on.text_input":521,"B":379,"Manifest_navigator":495,"mouse_cursor":558,"Viewport":567,"copy_shape":396,"update_editor_box":479,"vy":546,"set_mouse_cursor":562,"add_thick_line":400,"draw_ticks":566,"Cursor_node":172,"on.draw":565,"load_manifest":496,"on.mouse_release":554,"get_manifest":497,"on.update":561,"Mouse_cursor":559,"on.keychord_press":568,"parent":567,"Page":475,"Definitions":503,"new_definition":504,"y_of_schema1":364,"sx":544,"schema1_of_y":467,"font":353,"initialize_editor":450}
{"draw_ticks":566,"on_text":539,"Viewport":567,"sx":544,"vx":545,"update_editor_box":479,"on.mouse_press":556,"font":353,"initialize_editor":450,"parent":566,"Manifest":494,"schema1_of_y":467,"Page":475,"on.text_input":521,"mouse_cursor":558,"y_of_schema1":364,"Mouse_cursor":559,"set_mouse_cursor":562,"load_manifest":496,"get_manifest":497,"on.initialize":506,"on.mouse_release":554,"on.keychord_press":553,"on":1,"Surface":422,"Definitions":503,"sy":469,"new_definition":504,"scale":7,"box_height":345,"vy":546,"compute_layout":385,"A":507,"Manifest_navigator":495,"on.code_change":306,"on.draw":565,"on.key_release":552,"line_height":365,"add_thick_line":400,"Cursor_node":172,"copy_shape":396,"on_handle":547,"maybe_update_key_in_definitions":529,"B":379,"on.update":561}
Viewport = {x=-50, y=-50, w=800,h=600, zoom=1.0}
{"draw_ticks":566,"on_text":539,"Viewport":505,"sx":544,"vx":545,"update_editor_box":479,"on.mouse_press":556,"font":353,"initialize_editor":450,"parent":565,"Manifest":494,"schema1_of_y":467,"Page":475,"on.text_input":521,"mouse_cursor":558,"y_of_schema1":364,"Mouse_cursor":559,"set_mouse_cursor":562,"load_manifest":496,"get_manifest":497,"on.initialize":506,"on.mouse_release":554,"on.keychord_press":553,"on":1,"Surface":422,"Definitions":503,"sy":469,"new_definition":504,"scale":7,"box_height":345,"vy":546,"compute_layout":385,"A":507,"Manifest_navigator":495,"on.code_change":306,"on.draw":565,"on.key_release":552,"line_height":365,"add_thick_line":400,"Cursor_node":172,"copy_shape":396,"on_handle":547,"maybe_update_key_in_definitions":529,"B":379,"on.update":561}
draw_ticks = function()
-- x axis
local lo, hi = Viewport.x, sx(App.screen.width)
print('viewport width scale is', hi-lo, lo, hi)
-- y axis
local lo, hi = Viewport.y, sy(App.screen.height)
print('viewport height scale is', hi-lo, lo, hi)
end
on.draw = function()
love.graphics.setColor(1,0,0)
for _,obj in ipairs(Surface) do
love.graphics.setColor(obj.r or 0, obj.g or 0, obj.b or 0)
if obj.type == 'rectangle' then
love.graphics.rectangle(obj.drawmode or 'fill', vx(obj.x),vy(obj.y), scale(obj.w),scale(obj.h))
elseif obj.type == 'line' then
love.graphics.line(unpack(obj.zdata))
elseif obj.type == 'circle' then
love.graphics.circle(obj.drawmode or 'fill', vx(obj.x), vy(obj.y), scale(obj.radius))
elseif obj.type == 'arc' then
love.graphics.arc(obj.drawmode or 'line', obj.arctype or 'open', vx(obj.x), vy(obj.y), scale(obj.radius), obj.angle1, obj.angle2, obj.segments)
elseif obj.type == 'ellipse' then
love.graphics.ellipse(obj.drawmode or 'fill', vx(obj.x), vy(obj.y), scale(obj.radiusx), scale(obj.radiusy))
elseif obj.type == 'bezier' then
love.graphics.line(unpack(obj.zdata))
elseif obj.type == 'text' then
if obj.w == nil then
love.graphics.draw(obj.text, vx(obj.x), vy(obj.y))
else
love.graphics.setColor(0.5,0.5,0.5)
love.graphics.rectangle('fill', vx(obj.x),vy(obj.y-30), scale(obj.w/2-5), scale(20))
edit.draw(obj.editor, obj.fg, not obj.show_cursor)
end
end
end
draw_ticks()
draw_menu_bar()
end
{"draw_ticks":564,"on_text":539,"Viewport":505,"sx":544,"vx":545,"update_editor_box":479,"on.mouse_press":556,"font":353,"initialize_editor":450,"parent":564,"Manifest":494,"schema1_of_y":467,"Page":475,"on.text_input":521,"mouse_cursor":558,"y_of_schema1":364,"Mouse_cursor":559,"set_mouse_cursor":562,"load_manifest":496,"get_manifest":497,"on.initialize":506,"on.mouse_release":554,"on.keychord_press":553,"on":1,"Surface":422,"Definitions":503,"sy":469,"new_definition":504,"scale":7,"box_height":345,"vy":546,"compute_layout":385,"A":507,"Manifest_navigator":495,"on.code_change":306,"on.draw":565,"on.key_release":552,"line_height":365,"add_thick_line":400,"Cursor_node":172,"copy_shape":396,"on_handle":547,"maybe_update_key_in_definitions":529,"B":379,"on.update":561}
{"draw_ticks":564,"on_text":539,"Viewport":505,"sx":544,"vx":545,"update_editor_box":479,"on.mouse_press":556,"font":353,"initialize_editor":450,"parent":563,"Manifest":494,"schema1_of_y":467,"Page":475,"on.text_input":521,"mouse_cursor":558,"y_of_schema1":364,"Mouse_cursor":559,"set_mouse_cursor":562,"load_manifest":496,"get_manifest":497,"on.initialize":506,"on.mouse_release":554,"on.keychord_press":553,"on":1,"Surface":422,"Definitions":503,"sy":469,"new_definition":504,"scale":7,"box_height":345,"vy":546,"compute_layout":385,"A":507,"Manifest_navigator":495,"on.code_change":306,"on.draw":538,"on.key_release":552,"line_height":365,"add_thick_line":400,"Cursor_node":172,"copy_shape":396,"on_handle":547,"maybe_update_key_in_definitions":529,"B":379,"on.update":561}
draw_ticks = function()
-- x axis
local lo, hi = Viewport.x, sx(App.screen.width)
print('viewport width scale is', hi-lo)
-- y axis
local lo, hi = Viewport.y, sy(App.screen.height)
print('viewport height scale is', hi-lo)
end
{"draw_ticks":563,"on_text":539,"Viewport":505,"sx":544,"vx":545,"update_editor_box":479,"on.mouse_press":556,"font":353,"initialize_editor":450,"parent":562,"Manifest":494,"schema1_of_y":467,"Page":475,"on.text_input":521,"mouse_cursor":558,"y_of_schema1":364,"Mouse_cursor":559,"set_mouse_cursor":562,"load_manifest":496,"get_manifest":497,"on.initialize":506,"on.mouse_release":554,"on.keychord_press":553,"on":1,"Surface":422,"Definitions":503,"sy":469,"new_definition":504,"scale":7,"box_height":345,"vy":546,"compute_layout":385,"A":507,"Manifest_navigator":495,"on.code_change":306,"on.draw":538,"on.key_release":552,"line_height":365,"add_thick_line":400,"Cursor_node":172,"copy_shape":396,"on_handle":547,"maybe_update_key_in_definitions":529,"B":379,"on.update":561}
draw_ticks = function()
-- x axis
local lo, hi = Viewport.x, Viewport.x+App.screen.width/Viewport.zoom
end