resolve conflicts

akkartik
May 6, 2025, 10:02 PM
2EELKVO233KIH36SRY6LHYCDGARR52V62QPGONRZIKHXGV4RSNEQC

Dependencies

  • [2] 5GHT3LUX copy correct warning message
  • [3] KM6WXSKV pijul bugfix
  • [4] QXXISTGE resolve conflicts
  • [5] SYWQBIO5 resolve conflicts
  • [6] KFEUQWHX resolve conflicts
  • [7] EEOE6B5A bugfix
  • [8] A42EMHOQ plumb through all supported args in LÖVE handlers
  • [9] L2FWWEQL source: remember cursor position of multiple files
  • [10] BLWAYPKV extract a module
  • [11] LNUHQOGH start passing in Editor_state explicitly
  • [12] LIKTH6HM update stale source X-(
  • [13] LXTTOB33 extract a couple of files
  • [14] LYN3L74W correct commit f3abc2cbf2
  • [15] TXI6GSQD some minor cleanup
  • [16] 4SR3Z4Y3 document the version of LÖVE I've been using
  • [17] TVCPXAAU rename
  • [18] 3PSFWAIL Merge lines.love
  • [19] 5SM6DRHK port inscript's bugfix to source editor
  • [20] YF2ATH2Q Merge lines.love
  • [21] VPRGENLA hide some details within the 'warning' state
  • [22] 2TQUKHBC Merge lines.love
  • [23] 2TCIWW6Z stop caching starty
  • [24] CRBLAWBO resolve conflicts
  • [25] TYLURRX3 resolve conflicts
  • [26] 3AU3KLEU resolve conflicts
  • [27] PTDO2SOT add state arg to schedule_save
  • [28] QZ2SXLHF some debug prints
  • [29] 5RDWSYK2 consistently use App names for methods everywhere
  • [30] C45WCXJ2 keep drawings within the line width slider as well
  • [31] 3MJ2PYMW resolve conflicts
  • [32] 2J5CURWY ensure tapping on editor brings up soft keyboard
  • [33] 4EGQRXDA bugfix: naming points
  • [34] KKMFQDR4 editing source code from within the app
  • [35] TLOAPLBJ add a license
  • [36] 73OCE2MC after much struggle, a brute-force undo
  • [37] RXMHAZ6V resolve conflicts
  • [38] D4B52CQ2 Merge lines.love
  • [39] 4U4VQWNY Merge lines.love
  • [40] LDFXFRUO bring a few things in sync between run and source
  • [41] LWPFEZBI Merge lines.love
  • [42] U2TKUOID bugfix: undo drawing creation
  • [43] UTDSCN3G Merge lines.love
  • [44] 3P5RYCBL another missed rename
  • [45] RSZD5A7G forgot to add json.lua
  • [46] NMRUNROT Merge lines.love
  • [47] MX7YD2WC resolve conflicts
  • [48] ATQO62TF Merge lines.love
  • [49] 6LJZN727 handle chords
  • [50] JZR3QMTN Merge lines.love
  • [51] ZLJYLPOT Merge lines.love
  • [52] K2X6G75Z start writing some tests for drawings
  • [53] OTIBCAUJ love2d scaffold
  • [54] 4YDBYBA4 clean up memory leak experiments
  • [55] 2CTN2IEF Merge lines.love
  • [56] GLABQJQQ repeat bugfix on source editor X-(
  • [57] ZQDQLLCL bugfix
  • [58] XX7G2FFJ intermingle freehand line drawings with text
  • [59] SGMA5JLE save the list of tests in repo
  • [60] QJISOCHJ some temporary logging to catch a bug
  • [61] TFUNIT6M resolve conflicts
  • [62] 3QNOKBFM beginnings of a test harness
  • [63] BULPIBEG beginnings of a module for the text editor
  • [64] 5UKUADTW distinguish consistently between mouse buttons and other buttons
  • [65] VHUNJHXB Merge lines.love
  • [66] M6TH7VSZ rip out notion of Line_width
  • [67] VBU5YHLR Merge lines.love
  • [68] MD3W5IRA new fork: rip out drawing support
  • [69] JOPVPUSA editing source code from within the app
  • [70] JMUD7T3O get rid of ugly side-effects in tests
  • [71] XRP727K3 Merge lines.love
  • [72] OB5XOXVC deemphasize the source editor
  • [73] M5Y4H74F use my name for a dir
  • [74] TOXPJJYY resolve conflicts
  • [75] EKJUHVHB hoist out some common settings
  • [76] FBBHEUQN resolve conflicts
  • [77] QAMVLUK2 fix a crash involving mouse and drawings
  • [78] 5DOTWNVM right margin
  • [79] KMSL74GA support selections in the source editor
  • [80] ED4Z6ORC cleaner API for file-system access
  • [81] KYNGDE2C consistent names in a few more places
  • [82] T4FRZSYL delete an ancient, unused file
  • [83] OI4FPFIN support drawings in the source editor
  • [84] REAIVN7W Merge lines.love
  • [85] AQMZJXUR use editor state font for width calculations
  • [86] QZUFJMD5 resolve conflicts
  • [87] 6VJTQKW7 start supporting LÖVE v12
  • [88] VP5KC4XZ Merge lines.love
  • [89] GX5PD3CL consistently schedule_save after all mutations
  • [90] HRWN5V6J Devine's suggestion to try to live with just freehand
  • [91] KG7YVGVR Merge lines.love
  • [92] JIK7ZRYI bugfix: imprecision in drawing
  • [93] GFXWHTE6 mouse wheel support
  • [94] GX236KZG Revert "deemphasize the source editor"
  • [95] Z3TDYADA mouse button state in source editor
  • [96] QUCBJJSU don't always pop up keyboard on mobile devices
  • [97] MTJEVRJR add state arg to a few functions
  • [98] XGHCLIKB Merge lines.love
  • [99] FHZ5AG3M resolve conflicts
  • [100] ORKN6EOB Merge lines.love
  • [101] QIR3VBYI resolve conflicts
  • [102] 2CK5QI7W make love event names consistent
  • [103] VOU73AK6 Merge lines.love
  • [104] QXVD2RIF add state arg to Drawing.mouse_released
  • [105] 6DE7RBZ6 move mouse_released events to Drawing
  • [106] 2JBAEQHU Merge lines.love
  • [107] 7FPELAZB ah, I see the problem
  • [108] 6XCJX4DZ bugfix: inscript's bug
  • [109] YXQOITYS Merge lines.love
  • [110] R2ASHK5C fix a bad merge
  • [111] RT6EV6OP delegate update events to drawings
  • [112] D2GCFTTT clean up repl functionality
  • [113] PX7DDEMO autosave slightly less aggressively
  • [114] QMRQL2FO resolve conflicts
  • [115] TMWSQNZD bugfix in source editor: don't clear selection on M-arrow
  • [116] KVHUFUFV reorg
  • [117] LUNH47XX make text and drawings the same width
  • [118] KTZQ57HV replace globals with args in a few functions
  • [119] FS2ITYYH record a known issue
  • [120] OAHNWDYG .
  • [121] 3OTESDW6 move drawing.starty into line cache
  • [122] 32V6ZHQB Merge lines.love
  • [123] SPNMXTYR have file API operate on state object
  • [124] PQN7CU4H Merge lines.love
  • [125] UHB4GARJ left/right margin -> left/right coordinates
  • [126] 66X36NZN a little more prose describing manual_tests
  • [127] 5ITAXPEP wait a little to flush disk before quitting
  • [128] DRFE3B3Z mouse buttons are integers, not strings
  • [129] CE4LZV4T drop last couple of manual tests
  • [130] MU2HIRR6 Merge lines.love
  • [131] N2NUGNN4 include a brief reference enabling many useful apps
  • [132] OGUV4HSA remove some memory leaks from rendered fragments
  • [133] KKQKPGCI resolve conflicts
  • [134] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [135] 2IOWGOPG mousemoved handler
  • [136] JYB3RFWH bugfix in source editor
  • [137] Z3IQ6A4R bugfix
  • [138] 5HEZU3YS consume a mouse click when switching sides
  • [139] 23MA4T3G add state arg to Drawing.keychord_pressed
  • [140] 3HVBAZPA add state arg to a few functions
  • [141] BH7BT36L ctrl+a: select entire buffer
  • [142] EPRDIYDA bugfix in source editor
  • [143] GVJEOWYQ resolve conflicts
  • [144] G54H3YG2 get rid of all bifold text
  • [145] SW7BSBMJ several bugfixes in saving/loading cursor position
  • [146] CQVWNL4M resolve conflicts
  • [147] 7YGYHOEO Merge lines.love
  • [148] B3PRPOPH some more renames
  • [149] IFTYOERM line.y -> line_cache.starty in a few more places
  • [150] VHQCNMAR several more modules
  • [151] TBTRYEBP Merge lines.love
  • [152] IM6GSGVZ fix some arg names
  • [153] WKXJNESI resolve conflicts
  • [154] ONHKBLLC Merge lines.love
  • [155] AVTNUQYR basic test-enabled framework
  • [156] AYX33NBC Merge lines.love
  • [157] 2L5MEZV3 experiment: new edit namespace
  • [158] 3XNFQDDN Merge lines.love
  • [159] HYEAFRZ2 split mouse_pressed events between Text and Drawing
  • [160] MKPXANB5 bugfix: mouse clicks on file navigator above log browser side
  • [161] SCOXD4EO Merge lines.love
  • [162] DLQAEAC7 add state arg to Drawing.mouse_pressed
  • [163] MBAJPTDJ resolve conflicts
  • [164] S7CSVBHZ resolve conflicts
  • [165] RUB7L6GY resolve conflicts
  • [166] R5QXEHUI somebody stop me
  • [167] XNFTJHC4 split keyboard handling between Text and Drawing
  • [168] VXORMHME delete experimental REPL
  • [169] WK6UK5AJ enhance bugfix of commit a9aa3436f (Dec 2024)
  • [170] JKENJ2UG Merge lines.love
  • [171] R3KXFRZN get rid of to_text
  • [172] 34BZ5ZKN Merge lines.love
  • [173] 3TI67SEJ more bugfix
  • [174] XZ6QVCTT manually maintain mouse button press state
  • [175] Z3BQO2RK typo
  • [176] LF7BWEG4 group all editor globals

Change contents

  • file deletion: source_text.lua (----------)source_text.lua (----------)
    [9.2][9.147062:147101](),[9.2][9.147062:147101](),[9.147101][9.83723:83723]()
    function Text.keychord_press(State, chord, key, scancode, is_repeat)
    --? print('chord', chord, State.selection1.line, State.selection1.pos)
  • file deletion: source_edit.lua (----------)source_edit.lua (----------)
    [9.2][9.165725:165764](),[9.2][9.165725:165764](),[9.165764][9.152440:152440]()
    function edit.mouse_press(State, x,y, mouse_button, is_touch, presses)
    Drawing.mouse_press(State, line_index, x,y, mouse_button, is_touch, presses)
    function edit.mouse_release(State, x,y, mouse_button, is_touch, presses)
    Drawing.mouse_release(State, x,y, mouse_button, is_touch, presses)
    function edit.keychord_press(State, chord, key, scancode, is_repeat)
    Drawing.keychord_press(State, chord, key, scancode, is_repeat)
    Text.keychord_press(State, chord, key, scancode, is_repeat)
    end
    end
    record_undo_event(State, {before=before, after=snapshot(State, drawing_index)})
    schedule_save(State)
    end
    elseif chord == 'escape' and not App.mouse_down(1) then
    for _,line in ipairs(State.lines) do
    if line.mode == 'drawing' then
    line.show_help = false
    end
    end
    if State.selection1.line and
    not State.lines.current_drawing and
    -- printable character created using shift key => delete selection
    -- (we're not creating any ctrl-shift- or alt-shift- combinations using regular/printable keys)
    (not App.shift_down() or utf8.len(key) == 1) and
    if Drawing.before then
    record_undo_event(State, {before=Drawing.before, after=snapshot(State, State.lines.current_drawing_index)})
    Drawing.before = nil
    end
    if State.search_term then return end
    return
    if State.search_term then return end
  • file deletion: source.lua (----------)source.lua (----------)
    [9.2][9.177652:177686](),[9.2][9.177652:177686](),[9.177686][9.165766:165766]()
    function source.initialize(arg, unfiltered_arg)
    function source.resize(w,h)
    function source.mouse_press(x,y, mouse_button, is_touch, presses)
    edit.mouse_press(Editor_state, x,y, mouse_button, is_touch, presses)
    edit.mouse_press(Editor_state, x,y, mouse_button, is_touch, presses)
    log_browser.mouse_press(Log_browser_state, x,y, mouse_button, is_touch, presses)
    function source.mouse_release(x,y, mouse_button, is_touch, presses)
    return edit.mouse_release(Editor_state, x,y, mouse_button, is_touch, presses)
    return log_browser.mouse_release(Log_browser_state, x,y, mouse_button, is_touch, presses)
    function source.keychord_press(chord, key, scancode, is_repeat)
    return edit.keychord_press(Editor_state, chord, key, scancode, is_repeat)
    return log_browser.keychord_press(Log_browser_state, chord, key, scancode, is_repeat)
    return log_browser.key_release(Log_browser_state, key, scancode)
    end
    end
    end
    else
    Cursor_time = 0 -- ensure cursor is visible immediately after it moves
    --? print('source keychord')
    if Show_file_navigator then
    end
    end
    else
    Cursor_time = 0 -- ensure cursor is visible immediately after it moves
    if Focus == 'edit' then
    end
    end
    elseif Show_log_browser_side and Log_browser_state.left <= x and x < Log_browser_state.right then
    --? print('click on log_browser side')
    if Focus ~= 'log_browser' then
    Focus = 'log_browser'
    return
    end
    Cursor_time = 0 -- ensure cursor is visible immediately after it moves
    --? print(("Window resized to width: %d and height: %d."):format(w, h))
    App.screen.width, App.screen.height = w, h
    Text.redraw_all(Editor_state)
    Editor_state.selection1 = {} -- no support for shift drag while we're resizing
    if Show_log_browser_side then
    Editor_state.right = App.screen.width/2 - Margin_right
    else
    Editor_state.right = App.screen.width-Margin_right
    end
    Log_browser_state.left = App.screen.width/2 + Margin_right
    Log_browser_state.right = App.screen.width-Margin_right
    Editor_state.width = Editor_state.right-Editor_state.left
    Text.tweak_screen_top_and_cursor(Editor_state, Editor_state.left, Editor_state.right)
    --? print('end resize')
    end
    log_new('source')
  • file deletion: run.lua (----------)run.lua (----------)
    [9.2][9.184046:184077](),[9.2][9.184046:184077](),[9.184077][9.178044:178044]()
    function run.initialize(arg, unfiltered_arg)
    function run.resize(w,h)
    function run.mouse_press(x,y, mouse_button, is_touch, presses)
    return edit.mouse_press(Editor_state, x,y, mouse_button, is_touch, presses)
    function run.mouse_release(x,y, mouse_button, is_touch, presses)
    return edit.mouse_release(Editor_state, x,y, mouse_button, is_touch, presses)
    function run.keychord_press(chord, key, scancode, is_repeat)
    return edit.keychord_press(Editor_state, chord, key, scancode, is_repeat)
    end
    Cursor_time = 0 -- ensure cursor is visible immediately after it moves
    end
    Cursor_time = 0 -- ensure cursor is visible immediately after it moves
    end
    Cursor_time = 0 -- ensure cursor is visible immediately after it moves
    --? print(("Window resized to width: %d and height: %d."):format(w, h))
    App.screen.width, App.screen.height = w, h
    Text.redraw_all(Editor_state)
    Editor_state.selection1 = {} -- no support for shift drag while we're resizing
    Editor_state.right = App.screen.width-Margin_right
    Editor_state.width = Editor_state.right-Editor_state.left
    Text.tweak_screen_top_and_cursor(Editor_state, Editor_state.left, Editor_state.right)
    end
    log_new('run')
  • file deletion: log_browser.lua (----------)log_browser.lua (----------)
    [9.2][9.203223:203262](),[9.2][9.203223:203262](),[9.203262][9.191782:191782]()
    function log_browser.mouse_press(State, x,y, mouse_button, is_touch, presses)
    function log_browser.mouse_release(State, x,y, mouse_button, is_touch, presses)
    function log_browser.keychord_press(State, chord, key, scancode, is_repeat)
    -- move
    if chord == 'up' then
    end
    function log_browser.mouse_wheel_move(State, dx,dy)
    if dy > 0 then
    for i=1,math.floor(dy) do
    log_browser.up(State)
    end
    local line_index = log_browser.line_index(State, x,y)
    if line_index == nil then
    -- below lower margin
    return
    end
    -- leave some space to click without focusing
    local line = State.lines[line_index]
    local xleft = log_browser.left_margin(State, line)
    local xright = log_browser.right_margin(State, line)
    if x < xleft or x > xright then
    return
    end
    -- if it's a section begin/end and the section is collapsed, expand it
    -- TODO: how to collapse?
    if line.section_begin or line.section_end then
    -- HACK: get section reference from next/previous line
    local new_section
    if line.section_begin then
    if line_index < #State.lines then
    local next_section_stack = State.lines[line_index+1].section_stack
    if next_section_stack then
    new_section = next_section_stack[#next_section_stack]
    end
    end
    elseif line.section_end then
    if line_index > 1 then
    local previous_section_stack = State.lines[line_index-1].section_stack
    if previous_section_stack then
    new_section = previous_section_stack[#previous_section_stack]
    end
    end
    end
    if new_section and new_section.expanded == nil then
    new_section.expanded = true
    return
    end
    end
    -- open appropriate file in source side
    if line.filename ~= Editor_state.filename then
    source.switch_to_file(line.filename)
    end
    -- set cursor
  • replacement in source_text.lua at line 226
    [9.5515][9.5515:5558]()
    function Text.keychord_press(State, chord)
    [9.5515]
    [9.21139]
    function Text.keychord_press(State, chord, key, scancode, is_repeat)
  • replacement in source_edit.lua at line 235
    [9.157121][9.5563:5615]()
    function edit.mouse_press(State, x,y, mouse_button)
    [9.157121]
    [9.157175]
    function edit.mouse_press(State, x,y, mouse_button, is_touch, presses)
  • replacement in source_edit.lua at line 282
    [9.20742][9.5683:5749]()
    Drawing.mouse_press(State, line_index, x,y, mouse_button)
    [9.20742]
    [9.4943]
    Drawing.mouse_press(State, line_index, x,y, mouse_button, is_touch, presses)
  • replacement in source_edit.lua at line 295
    [9.157761][9.5750:5804]()
    function edit.mouse_release(State, x,y, mouse_button)
    [9.157761]
    [9.20835]
    function edit.mouse_release(State, x,y, mouse_button, is_touch, presses)
  • replacement in source_edit.lua at line 300
    [9.20935][9.5805:5857]()
    Drawing.mouse_release(State, x,y, mouse_button)
    [9.20935]
    [9.21013]
    Drawing.mouse_release(State, x,y, mouse_button, is_touch, presses)
  • replacement in source_edit.lua at line 386
    [9.158159][9.5927:5975]()
    function edit.keychord_press(State, chord, key)
    [9.158159]
    [9.25356]
    function edit.keychord_press(State, chord, key, scancode, is_repeat)
  • replacement in source_edit.lua at line 505
    [9.22039][9.5976:6019]()
    Drawing.keychord_press(State, chord)
    [9.22039]
    [9.22084]
    Drawing.keychord_press(State, chord, key, scancode, is_repeat)
  • replacement in source_edit.lua at line 538
    [9.163298][9.6020:6058]()
    Text.keychord_press(State, chord)
    [9.163191]
    [9.163338]
    Text.keychord_press(State, chord, key, scancode, is_repeat)
  • replacement in source.lua at line 59
    [9.166800][9.166800:166829]()
    function source.initialize()
    [9.166800]
    [9.517]
    function source.initialize(arg, unfiltered_arg)
  • replacement in source.lua at line 176
    [9.171278][9.171278:171307]()
    function source.resize(w, h)
    [9.171278]
    [9.171307]
    function source.resize(w,h)
  • replacement in source.lua at line 286
    [9.174633][9.6666:6713]()
    function source.mouse_press(x,y, mouse_button)
    [9.174633]
    [9.174682]
    function source.mouse_press(x,y, mouse_button, is_touch, presses)
  • replacement in source.lua at line 294
    [9.2826][9.6714:6768]()
    edit.mouse_press(Editor_state, x,y, mouse_button)
    [9.2826]
    [9.2882]
    edit.mouse_press(Editor_state, x,y, mouse_button, is_touch, presses)
  • replacement in source.lua at line 303
    [9.175054][9.6769:6823]()
    edit.mouse_press(Editor_state, x,y, mouse_button)
    [9.175054]
    [9.175110]
    edit.mouse_press(Editor_state, x,y, mouse_button, is_touch, presses)
  • replacement in source.lua at line 310
    [9.175324][9.6824:6890]()
    log_browser.mouse_press(Log_browser_state, x,y, mouse_button)
    [9.175324]
    [9.175506]
    log_browser.mouse_press(Log_browser_state, x,y, mouse_button, is_touch, presses)
  • replacement in source.lua at line 314
    [9.175517][9.6891:6940]()
    function source.mouse_release(x,y, mouse_button)
    [9.175517]
    [9.175567]
    function source.mouse_release(x,y, mouse_button, is_touch, presses)
  • replacement in source.lua at line 317
    [9.175667][9.6941:7004]()
    return edit.mouse_release(Editor_state, x,y, mouse_button)
    [9.175667]
    [9.175731]
    return edit.mouse_release(Editor_state, x,y, mouse_button, is_touch, presses)
  • replacement in source.lua at line 319
    [9.175738][9.7005:7080]()
    return log_browser.mouse_release(Log_browser_state, x,y, mouse_button)
    [9.175738]
    [9.175814]
    return log_browser.mouse_release(Log_browser_state, x,y, mouse_button, is_touch, presses)
  • replacement in source.lua at line 345
    [9.176070][9.7251:7294]()
    function source.keychord_press(chord, key)
    [9.176070]
    [9.176115]
    function source.keychord_press(chord, key, scancode, is_repeat)
  • replacement in source.lua at line 385
    [9.177101][9.7345:7402]()
    return edit.keychord_press(Editor_state, chord, key)
    [9.177101]
    [9.177160]
    return edit.keychord_press(Editor_state, chord, key, scancode, is_repeat)
  • replacement in source.lua at line 387
    [9.177167][9.7403:7472]()
    return log_browser.keychord_press(Log_browser_state, chord, key)
    [9.177167]
    [9.177238]
    return log_browser.keychord_press(Log_browser_state, chord, key, scancode, is_repeat)
  • replacement in source.lua at line 396
    [9.177458][9.7575:7652]()
    return log_browser.keychord_press(Log_browser_state, chordkey, scancode)
    [9.177458]
    [9.177681]
    return log_browser.key_release(Log_browser_state, key, scancode)
  • replacement in run.lua at line 14
    [9.178423][9.178423:178452]()
    function run.initialize(arg)
    [9.178423]
    [9.718]
    function run.initialize(arg, unfiltered_arg)
  • replacement in run.lua at line 103
    [9.181211][9.181211:181237]()
    function run.resize(w, h)
    [9.181211]
    [9.181237]
    function run.resize(w,h)
  • replacement in run.lua at line 169
    [9.314][9.16:60](),[9.182826][9.16:60]()
    function run.mouse_press(x,y, mouse_button)
    [9.314]
    [9.182872]
    function run.mouse_press(x,y, mouse_button, is_touch, presses)
  • replacement in run.lua at line 172
    [4.164][9.61:120](),[9.182946][9.61:120]()
    return edit.mouse_press(Editor_state, x,y, mouse_button)
    [4.164]
    [9.183007]
    return edit.mouse_press(Editor_state, x,y, mouse_button, is_touch, presses)
  • replacement in run.lua at line 175
    [9.183012][9.7687:7733]()
    function run.mouse_release(x,y, mouse_button)
    [9.183012]
    [9.183059]
    function run.mouse_release(x,y, mouse_button, is_touch, presses)
  • replacement in run.lua at line 177
    [9.183133][9.7734:7795]()
    return edit.mouse_release(Editor_state, x,y, mouse_button)
    [9.183133]
    [9.183195]
    return edit.mouse_release(Editor_state, x,y, mouse_button, is_touch, presses)
  • replacement in run.lua at line 190
    [9.183346][9.7867:7907]()
    function run.keychord_press(chord, key)
    [9.183346]
    [9.183388]
    function run.keychord_press(chord, key, scancode, is_repeat)
  • replacement in run.lua at line 192
    [9.183462][9.7908:7963]()
    return edit.keychord_press(Editor_state, chord, key)
    [9.183462]
    [9.183519]
    return edit.keychord_press(Editor_state, chord, key, scancode, is_repeat)
  • replacement in main.lua at line 210
    [9.8][9.8133:8173]()
    function App.keychord_press(chord, key)
    [9.8]
    [9.188176]
    function App.keychord_press(chord, key, scancode, is_repeat)
  • edit in main.lua at line 291
    [9.213][9.899:899](),[9.190572][8.2386:2450](),[9.190572][8.2386:2450](),[9.190572][8.2386:2450](),[9.190680][8.2451:2537](),[9.190680][8.2451:2537](),[9.190789][8.2538:2630](),[9.190789][8.2538:2630]()
    function App.mousepressed(x,y, mouse_button, is_touch, presses)
    if run.mouse_press then run.mouse_press(x,y, mouse_button, is_touch, presses) end
    if source.mouse_press then source.mouse_press(x,y, mouse_button, is_touch, presses) end
  • resolve order conflict in main.lua at line 291
    [9.213]
    [9.190866]
  • replacement in main.lua at line 296
    [9.361][9.190029:190074]()
    function App.mousepressed(x,y, mouse_button)
    [9.361]
    [9.1272]
    function App.mousepressed(x,y, mouse_button, is_touch, presses)
  • replacement in main.lua at line 300
    [9.190137][9.214:281]()
    if run.mouse_press then run.mouse_press(x,y, mouse_button) end
    [9.190137]
    [9.190208]
    if run.mouse_press then run.mouse_press(x,y, mouse_button, is_touch, presses) end
  • edit in main.lua at line 302
    [9.190246][9.282:355](),[9.355][9.946:946](),[9.361][8.2631:2696](),[9.361][8.2631:2696](),[9.191010][8.2697:2787](),[9.191010][8.2697:2787](),[9.191121][8.2788:2884](),[9.191121][8.2788:2884]()
    if source.mouse_press then source.mouse_press(x,y, mouse_button) end
    function App.mousereleased(x,y, mouse_button, is_touch, presses)
    if run.mouse_release then run.mouse_release(x,y, mouse_button, is_touch, presses) end
    if source.mouse_release then source.mouse_release(x,y, mouse_button, is_touch, presses) end
  • resurrect zombie in main.lua at line 302
    [9.842][9.823:894](),[9.946][9.823:894](),[8.2884][9.823:894](),[9.5101][9.823:894](),[9.5101][9.823:894]()
    else
    assert(false, 'unknown app "'..Current_app..'"')
    end
    end
  • resolve order conflict in main.lua at line 302
    [9.190246]
  • edit in main.lua at line 302
    [0.2248]
    [9.823]
    if source.mouse_press then source.mouse_press(x,y, mouse_button, is_touch, presses) end
  • replacement in main.lua at line 308
    [9.894][9.843:889]()
    function App.mousereleased(x,y, mouse_button)
    [9.894]
    [9.21]
    function App.mousereleased(x,y, mouse_button, is_touch, presses)
  • edit in main.lua at line 311
    [9.143][9.22:93](),[9.143][8.2885:2953]()
    if run.mouse_release then run.mouse_release(x,y, mouse_button) end
    if run.mouse_move then run.mouse_move(x,y, dx,dy, is_touch) end
  • resurrect zombie in main.lua at line 311
    [9.93][9.196:234](),[8.2953][9.196:234](),[9.196][9.196:234](),[9.196][9.196:234]()
    elseif Current_app == 'source' then
  • edit in main.lua at line 311
    [9.143]
    [9.196]
    if run.mouse_release then run.mouse_release(x,y, mouse_button, is_touch, presses) end
  • edit in main.lua at line 313
    [9.234][9.94:171](),[9.234][8.2954:3028]()
    if source.mouse_release then source.mouse_release(x,y, mouse_button) end
    if source.mouse_move then source.mouse_move(x,y, dx,dy, is_touch) end
  • resurrect zombie in main.lua at line 313
    [9.171][9.293:364](),[8.3028][9.293:364](),[9.293][9.293:364](),[9.293][9.293:364]()
    else
    assert(false, 'unknown app "'..Current_app..'"')
    end
    end
  • edit in main.lua at line 313
    [9.234]
    [9.293]
    if source.mouse_release then source.mouse_release(x,y, mouse_button, is_touch, presses) end
  • resurrect zombie in main.lua at line 321
    [9.889][9.925:956](),[9.1144][9.925:956](),[9.1404][9.925:956](),[9.925][9.925:956](),[9.925][9.925:956]()
    if Current_app == 'run' then
  • edit in main.lua at line 322
    [9.956][9.219:272]()
    if run.mouse_move then run.mouse_move(dx,dy) end
  • resurrect zombie in main.lua at line 322
    [9.272][9.1021:1059](),[9.961][9.1021:1059](),[9.1021][9.1021:1059](),[9.1021][9.1021:1059]()
    elseif Current_app == 'source' then
  • edit in main.lua at line 322
    [9.956]
    [9.1021]
    if run.mouse_move then run.mouse_move(x,y, dx,dy, is_touch) end
  • replacement in main.lua at line 324
    [9.1059][9.273:332]()
    if source.mouse_move then source.mouse_move(dx,dy) end
    [9.1059]
    [9.191200]
    if source.mouse_move then source.mouse_move(x,y, dx,dy, is_touch) end
  • edit in main.lua at line 395
    [9.8][8.2142:2203](),[9.8][8.2142:2203]()
    function App.keychord_press(chord, key, scancode, is_repeat)
  • resolve order conflict in main.lua at line 395
    [2.155]
  • replacement in log_browser.lua at line 186
    [9.198624][9.8475:8534]()
    function log_browser.mouse_press(State, x,y, mouse_button)
    [9.198624]
    [9.198685]
    function log_browser.mouse_press(State, x,y, mouse_button, is_touch, presses)
  • replacement in log_browser.lua at line 252
    [9.200825][9.8535:8596]()
    function log_browser.mouse_release(State, x,y, mouse_button)
    [9.200825]
    [9.1211]
    function log_browser.mouse_release(State, x,y, mouse_button, is_touch, presses)
  • replacement in log_browser.lua at line 270
    [9.200938][9.8640:8695]()
    function log_browser.keychord_press(State, chord, key)
    [9.200938]
    [9.200995]
    function log_browser.keychord_press(State, chord, key, scancode, is_repeat)
  • replacement in edit.lua at line 148
    [9.1770][9.1770:1822]()
    function edit.mouse_press(State, x,y, mouse_button)
    [9.1770]
    [9.1822]
    function edit.mouse_press(State, x,y, mouse_button, is_touch, presses)
  • replacement in edit.lua at line 193
    [9.3515][9.3515:3569]()
    function edit.mouse_release(State, x,y, mouse_button)
    [9.3515]
    [9.3569]
    function edit.mouse_release(State, x,y, mouse_button, is_touch, presses)
  • replacement in edit.lua at line 260
    [9.5460][9.5460:5508]()
    function edit.keychord_press(State, chord, key)
    [9.5460]
    [9.5508]
    function edit.keychord_press(State, chord, key, scancode, is_repeat)
  • replacement in edit.lua at line 370
    [9.10318][9.10318:10356]()
    Text.keychord_press(State, chord)
    [9.10211]
    [9.10356]
    Text.keychord_press(State, chord, key, scancode, is_repeat)
  • edit in edit.lua at line 447
    [9.12430][6.285:285](),[9.15878][8.3786:3850](),[9.15878][8.3786:3850](),[9.2865][8.3716:3785](),[9.2865][8.3716:3785](),[9.10343][8.3646:3715](),[9.10343][8.3646:3715](),[9.5377][8.3574:3645](),[9.5377][8.3574:3645](),[9.8364][8.3500:3573](),[9.8364][8.3500:3573](),[9.2295][8.3414:3499](),[9.2295][8.3414:3499](),[9.2295][8.3414:3499](),[9.6757][8.3342:3413](),[9.6757][8.3342:3413]()
    Text.keychord_press(State, chord, key, scancode, is_repeat)
    Drawing.keychord_press(State, chord, key, scancode, is_repeat)
    function edit.keychord_press(State, chord, key, scancode, is_repeat)
    Drawing.mouse_release(State, x,y, mouse_button, is_touch, presses)
    function edit.mouse_release(State, x,y, mouse_button, is_touch, presses)
    Drawing.mouse_press(State, line_index, x,y, mouse_button, is_touch, presses)
    function edit.mouse_press(State, x,y, mouse_button, is_touch, presses)
  • resolve order conflict in edit.lua at line 447
    [9.12430]
  • resurrect zombie in drawing.lua at line 127
    [9.7422][9.14880:17584](),[9.7422][9.14880:17584]()
    pmx,pmy = px(mx), py(my)
    local shape = drawing.pending
    if shape.mode == nil then
    -- nothing pending
    elseif shape.mode == 'freehand' then
    local shape_copy = deepcopy(shape)
    Drawing.smoothen(shape_copy)
    Drawing.draw_shape(drawing, shape_copy, top, left,right)
    elseif shape.mode == 'line' then
    if mx < 0 or mx >= 256 or my < 0 or my >= drawing.h then
    return
    end
    local p1 = drawing.points[shape.p1]
    love.graphics.line(px(p1.x),py(p1.y), pmx,pmy)
    elseif shape.mode == 'manhattan' then
    if mx < 0 or mx >= 256 or my < 0 or my >= drawing.h then
    return
    end
    local p1 = drawing.points[shape.p1]
    if math.abs(mx-p1.x) > math.abs(my-p1.y) then
    love.graphics.line(px(p1.x),py(p1.y), pmx, py(p1.y))
    else
    love.graphics.line(px(p1.x),py(p1.y), px(p1.x),pmy)
    end
    elseif shape.mode == 'polygon' then
    -- don't close the loop on a pending polygon
    local prev = nil
    for _,point in ipairs(shape.vertices) do
    local curr = drawing.points[point]
    if prev then
    love.graphics.line(px(prev.x),py(prev.y), px(curr.x),py(curr.y))
    end
    prev = curr
    end
    love.graphics.line(px(prev.x),py(prev.y), pmx,pmy)
    elseif shape.mode == 'rectangle' then
    local first = drawing.points[shape.vertices[1]]
    if #shape.vertices == 1 then
    love.graphics.line(px(first.x),py(first.y), pmx,pmy)
    return
    end
    local second = drawing.points[shape.vertices[2]]
    local thirdx,thirdy, fourthx,fourthy = Drawing.complete_rectangle(first.x,first.y, second.x,second.y, mx,my)
    love.graphics.line(px(first.x),py(first.y), px(second.x),py(second.y))
    love.graphics.line(px(second.x),py(second.y), px(thirdx),py(thirdy))
    love.graphics.line(px(thirdx),py(thirdy), px(fourthx),py(fourthy))
    love.graphics.line(px(fourthx),py(fourthy), px(first.x),py(first.y))
    elseif shape.mode == 'square' then
    local first = drawing.points[shape.vertices[1]]
    if #shape.vertices == 1 then
    love.graphics.line(px(first.x),py(first.y), pmx,pmy)
    return
    end
    local second = drawing.points[shape.vertices[2]]
    local thirdx,thirdy, fourthx,fourthy = Drawing.complete_square(first.x,first.y, second.x,second.y, mx,my)
    love.graphics.line(px(first.x),py(first.y), px(second.x),py(second.y))
    love.graphics.line(px(second.x),py(second.y), px(thirdx),py(thirdy))
    love.graphics.line(px(thirdx),py(thirdy), px(fourthx),py(fourthy))
    love.graphics.line(px(fourthx),py(fourthy), px(first.x),py(first.y))
    elseif shape.mode == 'circle' then
    local center = drawing.points[shape.center]
    if mx < 0 or mx >= 256 or my < 0 or my >= drawing.h then
    return
    end
  • resurrect zombie in drawing.lua at line 192
    [9.1410][9.17584:17629](),[9.17584][9.17584:17629](),[9.17584][9.17584:17629]()
    local cx,cy = px(center.x), py(center.y)
  • resurrect zombie in drawing.lua at line 194
    [9.1477][9.17716:18327](),[9.17716][9.17716:18327](),[9.17716][9.17716:18327]()
    elseif shape.mode == 'arc' then
    local center = drawing.points[shape.center]
    if mx < 0 or mx >= 256 or my < 0 or my >= drawing.h then
    return
    end
    shape.end_angle = geom.angle_with_hint(center.x,center.y, mx,my, shape.end_angle)
    local cx,cy = px(center.x), py(center.y)
    love.graphics.arc('line', 'open', cx,cy, Drawing.pixels(shape.radius, width), shape.start_angle, shape.end_angle, 360)
    elseif shape.mode == 'move' then
    -- nothing pending; changes are immediately committed
    elseif shape.mode == 'name' then
    -- nothing pending; changes are immediately committed
    else
  • resurrect zombie in drawing.lua at line 208
    [9.8904][9.18367:18373](),[9.18367][9.18367:18373](),[9.18367][9.18367:18373](),[9.18669][9.18669:18674](),[9.18669][9.18669:18674]()
    end
    end
  • resurrect zombie in drawing.lua at line 222
    [9.6250][9.10765:10770](),[9.6250][9.10765:10770](),[9.953][9.18675:18720](),[9.953][9.18675:18720]()
    end
    local drawing = State.lines[drawing_index]
  • replacement in drawing.lua at line 224
    [9.1479][9.883:953](),[9.8906][9.883:953](),[9.10770][9.883:953](),[9.18674][9.883:953](),[9.800][9.883:953](),[9.800][9.883:953]()
    function Drawing.mouse_press(State, drawing_index, x,y, mouse_button)
    [9.10770]
    [9.18675]
    function Drawing.mouse_press(State, drawing_index, x,y, mouse_button, is_touch, presses)
  • resurrect zombie in drawing.lua at line 227
    [9.10822][9.18773:18827](),[9.18773][9.18773:18827](),[9.18773][9.18773:18827]()
    local cx = Drawing.coord(x-State.left, State.width)
  • resurrect zombie in drawing.lua at line 229
    [9.10873][9.18888:19797](),[9.18888][9.18888:19797](),[9.18888][9.18888:19797]()
    if State.current_drawing_mode == 'freehand' then
    drawing.pending = {mode=State.current_drawing_mode, points={{x=cx, y=cy}}}
    elseif State.current_drawing_mode == 'line' or State.current_drawing_mode == 'manhattan' then
    local j = Drawing.find_or_insert_point(drawing.points, cx, cy, State.width)
    drawing.pending = {mode=State.current_drawing_mode, p1=j}
    elseif State.current_drawing_mode == 'polygon' or State.current_drawing_mode == 'rectangle' or State.current_drawing_mode == 'square' then
    local j = Drawing.find_or_insert_point(drawing.points, cx, cy, State.width)
    drawing.pending = {mode=State.current_drawing_mode, vertices={j}}
    elseif State.current_drawing_mode == 'circle' then
    local j = Drawing.find_or_insert_point(drawing.points, cx, cy, State.width)
    drawing.pending = {mode=State.current_drawing_mode, center=j}
    elseif State.current_drawing_mode == 'move' then
  • resurrect zombie in drawing.lua at line 242
    [9.7465][9.19798:19871](),[9.7465][9.19798:19871]()
    elseif State.current_drawing_mode == 'name' then
    -- nothing
    else
  • resurrect zombie in drawing.lua at line 246
    [9.8989][9.19927:20157](),[9.19927][9.19927:20157](),[9.19927][9.19927:20157]()
    end
    end
    -- a couple of operations on drawings need to constantly check the state of the mouse
    function Drawing.update(State)
    if State.lines.current_drawing == nil then return end
    local drawing = State.lines.current_drawing
  • resurrect zombie in drawing.lua at line 261
    [9.9067][9.20266:20370](),[9.20266][9.20266:20370](),[9.20266][9.20266:20370]()
    local pmx, pmy = App.mouse_x(), App.mouse_y()
    local mx = Drawing.coord(pmx-State.left, State.width)
  • resurrect zombie in drawing.lua at line 264
    [9.11024][9.20433:20461](),[9.20433][9.20433:20461](),[9.20433][9.20433:20461]()
    if App.mouse_down(1) then
  • resurrect zombie in drawing.lua at line 266
    [9.11104][9.20546:20939](),[9.20546][9.20546:20939](),[9.20546][9.20546:20939]()
    if drawing.pending.mode == 'freehand' then
    table.insert(drawing.pending.points, {x=mx, y=my})
    elseif drawing.pending.mode == 'move' then
    drawing.pending.target_point.x = mx
    drawing.pending.target_point.y = my
    Drawing.relax_constraints(drawing, drawing.pending.target_point_index)
    end
    end
    elseif State.current_drawing_mode == 'move' then
  • resurrect zombie in drawing.lua at line 276
    [9.11185][9.21025:21692](),[9.21025][9.21025:21692](),[9.21025][9.21025:21692](),[9.7523][9.21693:22064](),[9.7523][9.21693:22064]()
    drawing.pending.target_point.x = mx
    drawing.pending.target_point.y = my
    Drawing.relax_constraints(drawing, drawing.pending.target_point_index)
    end
    else
    -- do nothing
    end
    end
    function Drawing.relax_constraints(drawing, p)
    for _,shape in ipairs(drawing.shapes) do
    if shape.mode == 'manhattan' then
    if shape.p1 == p then
    shape.mode = 'line'
    elseif shape.p2 == p then
    shape.mode = 'line'
    end
    elseif shape.mode == 'rectangle' or shape.mode == 'square' then
    for _,v in ipairs(shape.vertices) do
    if v == p then
    shape.mode = 'polygon'
    end
    end
    end
    end
    end
    if State.current_drawing_mode == 'move' then
    State.current_drawing_mode = State.previous_drawing_mode
    State.previous_drawing_mode = nil
    if State.lines.current_drawing then
    State.lines.current_drawing.pending = {}
    State.lines.current_drawing = nil
    end
    elseif State.lines.current_drawing then
    local drawing = State.lines.current_drawing
  • replacement in drawing.lua at line 303
    [9.21692][9.11187:11187](),[9.21692][9.11187:11187](),[9.1658][9.7466:7523](),[9.9069][9.7466:7523](),[9.11187][9.7466:7523](),[9.21692][9.7466:7523](),[9.1875][9.7466:7523](),[9.1875][9.7466:7523]()
    function Drawing.mouse_release(State, x,y, mouse_button)
    [9.21692]
    [9.21693]
    function Drawing.mouse_release(State, x,y, mouse_button, is_touch, presses)
  • resurrect zombie in drawing.lua at line 314
    [9.11261][9.22139:22495](),[9.22139][9.22139:22495](),[9.22139][9.22139:22495]()
    if drawing.pending then
    if drawing.pending.mode == nil then
    -- nothing pending
    elseif drawing.pending.mode == 'freehand' then
    -- the last point added during update is good enough
    Drawing.smoothen(drawing.pending)
    table.insert(drawing.shapes, drawing.pending)
    elseif drawing.pending.mode == 'line' then
  • resurrect zombie in drawing.lua at line 323
    [9.11363][9.22607:22947](),[9.22607][9.22607:22947](),[9.22607][9.22607:22947]()
    if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h then
    drawing.pending.p2 = Drawing.find_or_insert_point(drawing.points, mx,my, State.width)
    table.insert(drawing.shapes, drawing.pending)
    end
    elseif drawing.pending.mode == 'manhattan' then
    local p1 = drawing.points[drawing.pending.p1]
  • resurrect zombie in drawing.lua at line 330
    [9.11465][9.23059:23470](),[9.23059][9.23059:23470](),[9.23059][9.23059:23470]()
    if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h then
    if math.abs(mx-p1.x) > math.abs(my-p1.y) then
    drawing.pending.p2 = Drawing.find_or_insert_point(drawing.points, mx, p1.y, State.width)
    else
    drawing.pending.p2 = Drawing.find_or_insert_point(drawing.points, p1.x, my, State.width)
    end
    local p2 = drawing.points[drawing.pending.p2]
  • resurrect zombie in drawing.lua at line 338
    [9.11579][9.23594:23714](),[9.23594][9.23594:23714](),[9.23594][9.23594:23714]()
    table.insert(drawing.shapes, drawing.pending)
    end
    elseif drawing.pending.mode == 'polygon' then
  • resurrect zombie in drawing.lua at line 342
    [9.11681][9.23826:24131](),[9.23826][9.23826:24131](),[9.23826][9.23826:24131]()
    if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h then
    table.insert(drawing.pending.vertices, Drawing.find_or_insert_point(drawing.points, mx,my, State.width))
    table.insert(drawing.shapes, drawing.pending)
    end
    elseif drawing.pending.mode == 'rectangle' then
  • resurrect zombie in drawing.lua at line 348
    [9.9183][9.24178:24225](),[9.24178][9.24178:24225](),[9.24178][9.24178:24225]()
    if #drawing.pending.vertices == 2 then
  • resurrect zombie in drawing.lua at line 350
    [9.11785][9.24339:25113](),[9.24339][9.24339:25113](),[9.24339][9.24339:25113]()
    if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h then
    local first = drawing.points[drawing.pending.vertices[1]]
    local second = drawing.points[drawing.pending.vertices[2]]
    local thirdx,thirdy, fourthx,fourthy = Drawing.complete_rectangle(first.x,first.y, second.x,second.y, mx,my)
    table.insert(drawing.pending.vertices, Drawing.find_or_insert_point(drawing.points, thirdx,thirdy, State.width))
    table.insert(drawing.pending.vertices, Drawing.find_or_insert_point(drawing.points, fourthx,fourthy, State.width))
    table.insert(drawing.shapes, drawing.pending)
    end
    else
    -- too few points; draw nothing
    end
    elseif drawing.pending.mode == 'square' then
  • resurrect zombie in drawing.lua at line 363
    [9.9294][9.25160:25207](),[9.25160][9.25160:25207](),[9.25160][9.25160:25207]()
    if #drawing.pending.vertices == 2 then
  • resurrect zombie in drawing.lua at line 365
    [9.11889][9.25321:26037](),[9.25321][9.25321:26037](),[9.25321][9.25321:26037]()
    if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h then
    local first = drawing.points[drawing.pending.vertices[1]]
    local second = drawing.points[drawing.pending.vertices[2]]
    local thirdx,thirdy, fourthx,fourthy = Drawing.complete_square(first.x,first.y, second.x,second.y, mx,my)
    table.insert(drawing.pending.vertices, Drawing.find_or_insert_point(drawing.points, thirdx,thirdy, State.width))
    table.insert(drawing.pending.vertices, Drawing.find_or_insert_point(drawing.points, fourthx,fourthy, State.width))
    table.insert(drawing.shapes, drawing.pending)
    end
    end
    elseif drawing.pending.mode == 'circle' then
  • resurrect zombie in drawing.lua at line 376
    [9.11991][9.26149:26475](),[9.26149][9.26149:26475](),[9.26149][9.26149:26475]()
    if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h then
    local center = drawing.points[drawing.pending.center]
    drawing.pending.radius = round(geom.dist(center.x,center.y, mx,my))
    table.insert(drawing.shapes, drawing.pending)
    end
    elseif drawing.pending.mode == 'arc' then
  • resurrect zombie in drawing.lua at line 383
    [9.12093][9.26587:26978](),[9.26587][9.26587:26978](),[9.26587][9.26587:26978]()
    if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h then
    local center = drawing.points[drawing.pending.center]
    drawing.pending.end_angle = geom.angle_with_hint(center.x,center.y, mx,my, drawing.pending.end_angle)
    table.insert(drawing.shapes, drawing.pending)
    end
    elseif drawing.pending.mode == 'name' then
    -- drop it
    else
  • resurrect zombie in drawing.lua at line 392
    [9.9375][9.27036:27152](),[9.27036][9.27036:27152](),[9.27036][9.27036:27152](),[9.7570][9.27153:31955](),[9.7570][9.27153:31955]()
    end
    State.lines.current_drawing.pending = {}
    State.lines.current_drawing = nil
    end
    end
    end
    if chord == 'C-p' and not App.mouse_down(1) then
    State.current_drawing_mode = 'freehand'
    elseif App.mouse_down(1) and chord == 'l' then
    State.current_drawing_mode = 'line'
    local _,drawing = Drawing.current_drawing(State)
    if drawing.pending.mode == 'freehand' then
    drawing.pending.p1 = Drawing.find_or_insert_point(drawing.points, drawing.pending.points[1].x, drawing.pending.points[1].y, State.width)
    elseif drawing.pending.mode == 'polygon' or drawing.pending.mode == 'rectangle' or drawing.pending.mode == 'square' then
    drawing.pending.p1 = drawing.pending.vertices[1]
    elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' then
    drawing.pending.p1 = drawing.pending.center
    end
    drawing.pending.mode = 'line'
    elseif chord == 'C-l' and not App.mouse_down(1) then
    State.current_drawing_mode = 'line'
    elseif App.mouse_down(1) and chord == 'm' then
    State.current_drawing_mode = 'manhattan'
    local drawing = Drawing.select_drawing_at_mouse(State)
    if drawing.pending.mode == 'freehand' then
    drawing.pending.p1 = Drawing.find_or_insert_point(drawing.points, drawing.pending.points[1].x, drawing.pending.points[1].y, State.width)
    elseif drawing.pending.mode == 'line' then
    -- do nothing
    elseif drawing.pending.mode == 'polygon' or drawing.pending.mode == 'rectangle' or drawing.pending.mode == 'square' then
    drawing.pending.p1 = drawing.pending.vertices[1]
    elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' then
    drawing.pending.p1 = drawing.pending.center
    end
    drawing.pending.mode = 'manhattan'
    elseif chord == 'C-m' and not App.mouse_down(1) then
    State.current_drawing_mode = 'manhattan'
    elseif chord == 'C-g' and not App.mouse_down(1) then
    State.current_drawing_mode = 'polygon'
    elseif App.mouse_down(1) and chord == 'g' then
    State.current_drawing_mode = 'polygon'
    local _,drawing = Drawing.current_drawing(State)
    if drawing.pending.mode == 'freehand' then
    drawing.pending.vertices = {Drawing.find_or_insert_point(drawing.points, drawing.pending.points[1].x, drawing.pending.points[1].y, State.width)}
    elseif drawing.pending.mode == 'line' or drawing.pending.mode == 'manhattan' then
    if drawing.pending.vertices == nil then
    drawing.pending.vertices = {drawing.pending.p1}
    end
    elseif drawing.pending.mode == 'rectangle' or drawing.pending.mode == 'square' then
    -- reuse existing vertices
    elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' then
    drawing.pending.vertices = {drawing.pending.center}
    end
    drawing.pending.mode = 'polygon'
    elseif chord == 'C-r' and not App.mouse_down(1) then
    State.current_drawing_mode = 'rectangle'
    elseif App.mouse_down(1) and chord == 'r' then
    State.current_drawing_mode = 'rectangle'
    local _,drawing = Drawing.current_drawing(State)
    if drawing.pending.mode == 'freehand' then
    drawing.pending.vertices = {Drawing.find_or_insert_point(drawing.points, drawing.pending.points[1].x, drawing.pending.points[1].y, State.width)}
    elseif drawing.pending.mode == 'line' or drawing.pending.mode == 'manhattan' then
    if drawing.pending.vertices == nil then
    drawing.pending.vertices = {drawing.pending.p1}
    end
    elseif drawing.pending.mode == 'polygon' or drawing.pending.mode == 'square' then
    -- reuse existing (1-2) vertices
    elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' then
    drawing.pending.vertices = {drawing.pending.center}
    end
    drawing.pending.mode = 'rectangle'
    elseif chord == 'C-s' and not App.mouse_down(1) then
    State.current_drawing_mode = 'square'
    elseif App.mouse_down(1) and chord == 's' then
    State.current_drawing_mode = 'square'
    local _,drawing = Drawing.current_drawing(State)
    if drawing.pending.mode == 'freehand' then
    drawing.pending.vertices = {Drawing.find_or_insert_point(drawing.points, drawing.pending.points[1].x, drawing.pending.points[1].y, State.width)}
    elseif drawing.pending.mode == 'line' or drawing.pending.mode == 'manhattan' then
    if drawing.pending.vertices == nil then
    drawing.pending.vertices = {drawing.pending.p1}
    end
    elseif drawing.pending.mode == 'polygon' then
    while #drawing.pending.vertices > 2 do
    table.remove(drawing.pending.vertices)
    end
    elseif drawing.pending.mode == 'rectangle' then
    -- reuse existing (1-2) vertices
    elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' then
    drawing.pending.vertices = {drawing.pending.center}
    end
    drawing.pending.mode = 'square'
    elseif App.mouse_down(1) and chord == 'p' and State.current_drawing_mode == 'polygon' then
  • replacement in drawing.lua at line 399
    [9.27152][9.12095:12095](),[9.27152][9.12095:12095](),[9.9377][9.7524:7570](),[9.12095][9.7524:7570](),[9.27152][9.7524:7570](),[9.19077][9.7524:7570](),[9.19077][9.7524:7570]()
    function Drawing.keychord_press(State, chord)
    [9.27152]
    [9.27153]
    function Drawing.keychord_press(State, chord, key, scancode, is_repeat)
  • resurrect zombie in drawing.lua at line 489
    [9.12335][9.32151:32415](),[9.32151][9.32151:32415](),[9.32151][9.32151:32415]()
    local j = Drawing.find_or_insert_point(drawing.points, mx,my, State.width)
    table.insert(drawing.pending.vertices, j)
    elseif App.mouse_down(1) and chord == 'p' and (State.current_drawing_mode == 'rectangle' or State.current_drawing_mode == 'square') then
  • resurrect zombie in drawing.lua at line 495
    [9.12575][9.32611:33022](),[9.32611][9.32611:33022](),[9.32611][9.32611:33022]()
    local j = Drawing.find_or_insert_point(drawing.points, mx,my, State.width)
    while #drawing.pending.vertices >= 2 do
    table.remove(drawing.pending.vertices)
    end
    table.insert(drawing.pending.vertices, j)
    elseif chord == 'C-o' and not App.mouse_down(1) then
    State.current_drawing_mode = 'circle'
    elseif App.mouse_down(1) and chord == 'a' and State.current_drawing_mode == 'circle' then
  • resurrect zombie in drawing.lua at line 505
    [9.12694][9.33086:33119](),[9.33086][9.33086:33119](),[9.33086][9.33086:33119]()
    drawing.pending.mode = 'arc'
  • resurrect zombie in drawing.lua at line 507
    [9.12816][9.33251:34209](),[9.33251][9.33251:34209](),[9.33251][9.33251:34209]()
    local center = drawing.points[drawing.pending.center]
    drawing.pending.radius = round(geom.dist(center.x,center.y, mx,my))
    drawing.pending.start_angle = geom.angle(center.x,center.y, mx,my)
    elseif App.mouse_down(1) and chord == 'o' then
    State.current_drawing_mode = 'circle'
    local _,drawing = Drawing.current_drawing(State)
    if drawing.pending.mode == 'freehand' then
    drawing.pending.center = Drawing.find_or_insert_point(drawing.points, drawing.pending.points[1].x, drawing.pending.points[1].y, State.width)
    elseif drawing.pending.mode == 'line' or drawing.pending.mode == 'manhattan' then
    drawing.pending.center = drawing.pending.p1
    elseif drawing.pending.mode == 'polygon' or drawing.pending.mode == 'rectangle' or drawing.pending.mode == 'square' then
    drawing.pending.center = drawing.pending.vertices[1]
    end
    drawing.pending.mode = 'circle'
    elseif chord == 'C-u' and not App.mouse_down(1) then
  • resurrect zombie in drawing.lua at line 523
    [9.12894][9.34295:34740](),[9.34295][9.34295:34740](),[9.34295][9.34295:34740]()
    if drawing then
    if State.previous_drawing_mode == nil then
    State.previous_drawing_mode = State.current_drawing_mode
    end
    State.current_drawing_mode = 'move'
    drawing.pending = {mode=State.current_drawing_mode, target_point=p, target_point_index=i}
    State.lines.current_drawing_index = drawing_index
    State.lines.current_drawing = drawing
    end
    elseif chord == 'C-n' and not App.mouse_down(1) then
  • resurrect zombie in drawing.lua at line 534
    [9.12982][9.34836:35589](),[9.34836][9.34836:35589](),[9.34836][9.34836:35589]()
    if drawing then
    if State.previous_drawing_mode == nil then
    -- don't clobber
    State.previous_drawing_mode = State.current_drawing_mode
    end
    State.current_drawing_mode = 'name'
    p.name = ''
    drawing.pending = {mode=State.current_drawing_mode, target_point=point_index}
    State.lines.current_drawing_index = drawing_index
    State.lines.current_drawing = drawing
    end
    elseif chord == 'C-d' and not App.mouse_down(1) then
    local _,drawing,_,i,p = Drawing.select_point_at_mouse(State)
    if drawing then
    for _,shape in ipairs(drawing.shapes) do
    if Drawing.contains_point(shape, i) then
    if shape.mode == 'polygon' then
    local idx = table.find(shape.vertices, i)
  • resurrect zombie in drawing.lua at line 553
    [9.9440][9.35613:38422](),[9.35613][9.35613:38422](),[9.35613][9.35613:38422]()
    table.remove(shape.vertices, idx)
    if #shape.vertices < 3 then
    shape.mode = 'deleted'
    end
    else
    shape.mode = 'deleted'
    end
    end
    end
    drawing.points[i].deleted = true
    end
    local drawing,_,_,shape = Drawing.select_shape_at_mouse(State)
    if drawing then
    shape.mode = 'deleted'
    end
    elseif chord == 'C-h' and not App.mouse_down(1) then
    local drawing = Drawing.select_drawing_at_mouse(State)
    if drawing then
    drawing.show_help = true
    end
    elseif chord == 'escape' and App.mouse_down(1) then
    local _,drawing = Drawing.current_drawing(State)
    drawing.pending = {}
    end
    end
    function Drawing.complete_rectangle(firstx,firsty, secondx,secondy, x,y)
    if firstx == secondx then
    return x,secondy, x,firsty
    end
    if firsty == secondy then
    return secondx,y, firstx,y
    end
    local first_slope = (secondy-firsty)/(secondx-firstx)
    -- slope of second edge:
    -- -1/first_slope
    -- equation of line containing the second edge:
    -- y-secondy = -1/first_slope*(x-secondx)
    -- => 1/first_slope*x + y + (- secondy - secondx/first_slope) = 0
    -- now we want to find the point on this line that's closest to the mouse pointer.
    -- https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line#Line_defined_by_an_equation
    local a = 1/first_slope
    local c = -secondy - secondx/first_slope
    local thirdx = round(((x-a*y) - a*c) / (a*a + 1))
    local thirdy = round((a*(-x + a*y) - c) / (a*a + 1))
    -- slope of third edge = first_slope
    -- equation of line containing third edge:
    -- y - thirdy = first_slope*(x-thirdx)
    -- => -first_slope*x + y + (-thirdy + thirdx*first_slope) = 0
    -- now we want to find the point on this line that's closest to the first point
    local a = -first_slope
    local c = -thirdy + thirdx*first_slope
    local fourthx = round(((firstx-a*firsty) - a*c) / (a*a + 1))
    local fourthy = round((a*(-firstx + a*firsty) - c) / (a*a + 1))
    return thirdx,thirdy, fourthx,fourthy
    end
    function Drawing.complete_square(firstx,firsty, secondx,secondy, x,y)
    -- use x,y only to decide which side of the first edge to complete the square on
    local deltax = secondx-firstx
    local deltay = secondy-firsty
    local thirdx = secondx+deltay
    local thirdy = secondy-deltax
    if not geom.same_side(firstx,firsty, secondx,secondy, thirdx,thirdy, x,y) then
    deltax = -deltax
    deltay = -deltay
    thirdx = secondx+deltay
    thirdy = secondy-deltax
    end
    local fourthx = firstx+deltay
    local fourthy = firsty-deltax
    return thirdx,thirdy, fourthx,fourthy
    end
    function Drawing.current_drawing(State)
    local x, y = App.mouse_x(), App.mouse_y()
    for drawing_index,drawing in ipairs(State.lines) do
    if drawing.mode == 'drawing' then
  • resurrect zombie in drawing.lua at line 633
    [9.13104][9.38610:38838](),[9.38610][9.38610:38838](),[9.38610][9.38610:38838]()
    end
    end
    end
    return nil
    end
    function Drawing.select_shape_at_mouse(State)
    for drawing_index,drawing in ipairs(State.lines) do
    if drawing.mode == 'drawing' then
    local x, y = App.mouse_x(), App.mouse_y()
  • resurrect zombie in drawing.lua at line 646
    [9.13345][9.39090:39139](),[9.39090][9.39090:39139](),[9.39090][9.39090:39139](),[9.39163][9.39163:39218](),[9.39163][9.39163:39218]()
    for i,shape in ipairs(drawing.shapes) do
    if geom.on_shape(mx,my, drawing, shape) then
  • resurrect zombie in drawing.lua at line 649
    [9.13388][9.39264:39505](),[9.39264][9.39264:39505](),[9.39264][9.39264:39505]()
    end
    end
    end
    end
    end
    end
    function Drawing.select_point_at_mouse(State)
    for drawing_index,drawing in ipairs(State.lines) do
    if drawing.mode == 'drawing' then
    local x, y = App.mouse_x(), App.mouse_y()
  • resurrect zombie in drawing.lua at line 663
    [9.13629][9.39757:39806](),[9.39757][9.39757:39806](),[9.39757][9.39757:39806](),[9.39830][9.39830:39888](),[9.39830][9.39830:39888]()
    for i,point in ipairs(drawing.points) do
    if Drawing.near(point, mx,my, State.width) then
  • resurrect zombie in drawing.lua at line 666
    [9.13686][9.39948:40191](),[9.39948][9.39948:40191](),[9.39948][9.39948:40191]()
    end
    end
    end
    end
    end
    end
    function Drawing.select_drawing_at_mouse(State)
    for drawing_index,drawing in ipairs(State.lines) do
    if drawing.mode == 'drawing' then
    local x, y = App.mouse_x(), App.mouse_y()
  • resurrect zombie in drawing.lua at line 678
    [9.13771][9.40331:40949](),[9.40331][9.40331:40949](),[9.40331][9.40331:40949]()
    return drawing
    end
    end
    end
    end
    function Drawing.contains_point(shape, p)
    if shape.mode == 'freehand' then
    -- not supported
    elseif shape.mode == 'line' or shape.mode == 'manhattan' then
    return shape.p1 == p or shape.p2 == p
    elseif shape.mode == 'polygon' or shape.mode == 'rectangle' or shape.mode == 'square' then
    return table.find(shape.vertices, p)
    elseif shape.mode == 'circle' then
    return shape.center == p
    elseif shape.mode == 'arc' then
    return shape.center == p
    -- ugh, how to support angles
    elseif shape.mode == 'deleted' then
    -- already done
    else
  • resurrect zombie in drawing.lua at line 700
    [9.9507][9.40989:41033](),[9.40989][9.40989:41033](),[9.40989][9.40989:41033]()
    end
    end
    function Drawing.smoothen(shape)
  • resurrect zombie in drawing.lua at line 705
    [9.9580][9.41068:42200](),[9.41068][9.41068:42200](),[9.41068][9.41068:42200]()
    for _=1,7 do
    for i=2,#shape.points-1 do
    local a = shape.points[i-1]
    local b = shape.points[i]
    local c = shape.points[i+1]
    b.x = round((a.x + b.x + c.x)/3)
    b.y = round((a.y + b.y + c.y)/3)
    end
    end
    end
    function round(num)
    return math.floor(num+.5)
    end
    function Drawing.find_or_insert_point(points, x,y, width)
    -- check if UI would snap the two points together
    for i,point in ipairs(points) do
    if Drawing.near(point, x,y, width) then
    return i
    end
    end
    table.insert(points, {x=x, y=y})
    return #points
    end
    function Drawing.near(point, x,y, width)
    local px,py = Drawing.pixels(x, width),Drawing.pixels(y, width)
    local cx,cy = Drawing.pixels(point.x, width), Drawing.pixels(point.y, width)
    return (cx-px)*(cx-px) + (cy-py)*(cy-py) < Same_point_distance*Same_point_distance
    end
    function Drawing.pixels(n, width) -- parts to pixels
    return math.floor(n*width/256)
    end
    function Drawing.coord(n, width) -- pixels to parts
    return math.floor(n*256/width)
    end
    function table.find(h, x)
    for k,v in pairs(h) do
    if v == x then
    return k
    end
    end
    end
  • edit in drawing.lua at line 751
    [9.42200][9.13773:13773](),[9.800][8.3851:3940](),[9.800][8.3851:3940](),[9.1875][8.3941:4017](),[9.1875][8.3941:4017](),[9.19077][8.4018:4090](),[9.19077][8.4018:4090]()
    function Drawing.mouse_press(State, drawing_index, x,y, mouse_button, is_touch, presses)
    function Drawing.mouse_release(State, x,y, mouse_button, is_touch, presses)
    function Drawing.keychord_press(State, chord, key, scancode, is_repeat)
  • resolve order conflict in drawing.lua at line 751
    [9.42200]