resolve conflicts
Dependencies
- [2]
5GHT3LUXcopy correct warning message - [3]
KM6WXSKVpijul bugfix - [4]
QXXISTGEresolve conflicts - [5]
SYWQBIO5resolve conflicts - [6]
KFEUQWHXresolve conflicts - [7]
EEOE6B5Abugfix - [8]
A42EMHOQplumb through all supported args in LÖVE handlers - [9]
L2FWWEQLsource: remember cursor position of multiple files - [10]
BLWAYPKVextract a module - [11]
LNUHQOGHstart passing in Editor_state explicitly - [12]
LIKTH6HMupdate stale source X-( - [13]
LXTTOB33extract a couple of files - [14]
LYN3L74Wcorrect commit f3abc2cbf2 - [15]
TXI6GSQDsome minor cleanup - [16]
4SR3Z4Y3document the version of LÖVE I've been using - [17]
TVCPXAAUrename - [18]
3PSFWAILMerge lines.love - [19]
5SM6DRHKport inscript's bugfix to source editor - [20]
YF2ATH2QMerge lines.love - [21]
VPRGENLAhide some details within the 'warning' state - [22]
2TQUKHBCMerge lines.love - [23]
2TCIWW6Zstop caching starty - [24]
CRBLAWBOresolve conflicts - [25]
TYLURRX3resolve conflicts - [26]
3AU3KLEUresolve conflicts - [27]
PTDO2SOTadd state arg to schedule_save - [28]
QZ2SXLHFsome debug prints - [29]
5RDWSYK2consistently use App names for methods everywhere - [30]
C45WCXJ2keep drawings within the line width slider as well - [31]
3MJ2PYMWresolve conflicts - [32]
2J5CURWYensure tapping on editor brings up soft keyboard - [33]
4EGQRXDAbugfix: naming points - [34]
KKMFQDR4editing source code from within the app - [35]
TLOAPLBJadd a license - [36]
73OCE2MCafter much struggle, a brute-force undo - [37]
RXMHAZ6Vresolve conflicts - [38]
D4B52CQ2Merge lines.love - [39]
4U4VQWNYMerge lines.love - [40]
LDFXFRUObring a few things in sync between run and source - [41]
LWPFEZBIMerge lines.love - [42]
U2TKUOIDbugfix: undo drawing creation - [43]
UTDSCN3GMerge lines.love - [44]
3P5RYCBLanother missed rename - [45]
RSZD5A7Gforgot to add json.lua - [46]
NMRUNROTMerge lines.love - [47]
MX7YD2WCresolve conflicts - [48]
ATQO62TFMerge lines.love - [49]
6LJZN727handle chords - [50]
JZR3QMTNMerge lines.love - [51]
ZLJYLPOTMerge lines.love - [52]
K2X6G75Zstart writing some tests for drawings - [53]
OTIBCAUJlove2d scaffold - [54]
4YDBYBA4clean up memory leak experiments - [55]
2CTN2IEFMerge lines.love - [56]
GLABQJQQrepeat bugfix on source editor X-( - [57]
ZQDQLLCLbugfix - [58]
XX7G2FFJintermingle freehand line drawings with text - [59]
SGMA5JLEsave the list of tests in repo - [60]
QJISOCHJsome temporary logging to catch a bug - [61]
TFUNIT6Mresolve conflicts - [62]
3QNOKBFMbeginnings of a test harness - [63]
BULPIBEGbeginnings of a module for the text editor - [64]
5UKUADTWdistinguish consistently between mouse buttons and other buttons - [65]
VHUNJHXBMerge lines.love - [66]
M6TH7VSZrip out notion of Line_width - [67]
VBU5YHLRMerge lines.love - [68]
MD3W5IRAnew fork: rip out drawing support - [69]
JOPVPUSAediting source code from within the app - [70]
JMUD7T3Oget rid of ugly side-effects in tests - [71]
XRP727K3Merge lines.love - [72]
OB5XOXVCdeemphasize the source editor - [73]
M5Y4H74Fuse my name for a dir - [74]
TOXPJJYYresolve conflicts - [75]
EKJUHVHBhoist out some common settings - [76]
FBBHEUQNresolve conflicts - [77]
QAMVLUK2fix a crash involving mouse and drawings - [78]
5DOTWNVMright margin - [79]
KMSL74GAsupport selections in the source editor - [80]
ED4Z6ORCcleaner API for file-system access - [81]
KYNGDE2Cconsistent names in a few more places - [82]
T4FRZSYLdelete an ancient, unused file - [83]
OI4FPFINsupport drawings in the source editor - [84]
REAIVN7WMerge lines.love - [85]
AQMZJXURuse editor state font for width calculations - [86]
QZUFJMD5resolve conflicts - [87]
6VJTQKW7start supporting LÖVE v12 - [88]
VP5KC4XZMerge lines.love - [89]
GX5PD3CLconsistently schedule_save after all mutations - [90]
HRWN5V6JDevine's suggestion to try to live with just freehand - [91]
KG7YVGVRMerge lines.love - [92]
JIK7ZRYIbugfix: imprecision in drawing - [93]
GFXWHTE6mouse wheel support - [94]
GX236KZGRevert "deemphasize the source editor" - [95]
Z3TDYADAmouse button state in source editor - [96]
QUCBJJSUdon't always pop up keyboard on mobile devices - [97]
MTJEVRJRadd state arg to a few functions - [98]
XGHCLIKBMerge lines.love - [99]
FHZ5AG3Mresolve conflicts - [100]
ORKN6EOBMerge lines.love - [101]
QIR3VBYIresolve conflicts - [102]
2CK5QI7Wmake love event names consistent - [103]
VOU73AK6Merge lines.love - [104]
QXVD2RIFadd state arg to Drawing.mouse_released - [105]
6DE7RBZ6move mouse_released events to Drawing - [106]
2JBAEQHUMerge lines.love - [107]
7FPELAZBah, I see the problem - [108]
6XCJX4DZbugfix: inscript's bug - [109]
YXQOITYSMerge lines.love - [110]
R2ASHK5Cfix a bad merge - [111]
RT6EV6OPdelegate update events to drawings - [112]
D2GCFTTTclean up repl functionality - [113]
PX7DDEMOautosave slightly less aggressively - [114]
QMRQL2FOresolve conflicts - [115]
TMWSQNZDbugfix in source editor: don't clear selection on M-arrow - [116]
KVHUFUFVreorg - [117]
LUNH47XXmake text and drawings the same width - [118]
KTZQ57HVreplace globals with args in a few functions - [119]
FS2ITYYHrecord a known issue - [120]
OAHNWDYG. - [121]
3OTESDW6move drawing.starty into line cache - [122]
32V6ZHQBMerge lines.love - [123]
SPNMXTYRhave file API operate on state object - [124]
PQN7CU4HMerge lines.love - [125]
UHB4GARJleft/right margin -> left/right coordinates - [126]
66X36NZNa little more prose describing manual_tests - [127]
5ITAXPEPwait a little to flush disk before quitting - [128]
DRFE3B3Zmouse buttons are integers, not strings - [129]
CE4LZV4Tdrop last couple of manual tests - [130]
MU2HIRR6Merge lines.love - [131]
N2NUGNN4include a brief reference enabling many useful apps - [132]
OGUV4HSAremove some memory leaks from rendered fragments - [133]
KKQKPGCIresolve conflicts - [134]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [135]
2IOWGOPGmousemoved handler - [136]
JYB3RFWHbugfix in source editor - [137]
Z3IQ6A4Rbugfix - [138]
5HEZU3YSconsume a mouse click when switching sides - [139]
23MA4T3Gadd state arg to Drawing.keychord_pressed - [140]
3HVBAZPAadd state arg to a few functions - [141]
BH7BT36Lctrl+a: select entire buffer - [142]
EPRDIYDAbugfix in source editor - [143]
GVJEOWYQresolve conflicts - [144]
G54H3YG2get rid of all bifold text - [145]
SW7BSBMJseveral bugfixes in saving/loading cursor position - [146]
CQVWNL4Mresolve conflicts - [147]
7YGYHOEOMerge lines.love - [148]
B3PRPOPHsome more renames - [149]
IFTYOERMline.y -> line_cache.starty in a few more places - [150]
VHQCNMARseveral more modules - [151]
TBTRYEBPMerge lines.love - [152]
IM6GSGVZfix some arg names - [153]
WKXJNESIresolve conflicts - [154]
ONHKBLLCMerge lines.love - [155]
AVTNUQYRbasic test-enabled framework - [156]
AYX33NBCMerge lines.love - [157]
2L5MEZV3experiment: new edit namespace - [158]
3XNFQDDNMerge lines.love - [159]
HYEAFRZ2split mouse_pressed events between Text and Drawing - [160]
MKPXANB5bugfix: mouse clicks on file navigator above log browser side - [161]
SCOXD4EOMerge lines.love - [162]
DLQAEAC7add state arg to Drawing.mouse_pressed - [163]
MBAJPTDJresolve conflicts - [164]
S7CSVBHZresolve conflicts - [165]
RUB7L6GYresolve conflicts - [166]
R5QXEHUIsomebody stop me - [167]
XNFTJHC4split keyboard handling between Text and Drawing - [168]
VXORMHMEdelete experimental REPL - [169]
WK6UK5AJenhance bugfix of commit a9aa3436f (Dec 2024) - [170]
JKENJ2UGMerge lines.love - [171]
R3KXFRZNget rid of to_text - [172]
34BZ5ZKNMerge lines.love - [173]
3TI67SEJmore bugfix - [174]
XZ6QVCTTmanually maintain mouse button press state - [175]
Z3BQO2RKtypo - [176]
LF7BWEG4group all editor globals
Change contents
- file deletion: source_text.lua source_text.lua
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
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)endendrecord_undo_event(State, {before=before, after=snapshot(State, drawing_index)})schedule_save(State)endelseif chord == 'escape' and not App.mouse_down(1) thenfor _,line in ipairs(State.lines) doif line.mode == 'drawing' thenline.show_help = falseendendif State.selection1.line andnot 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) andif Drawing.before thenrecord_undo_event(State, {before=Drawing.before, after=snapshot(State, State.lines.current_drawing_index)})Drawing.before = nilendif State.search_term then return endreturnif State.search_term then return end - file deletion: source.lua source.lua
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)endendendelseCursor_time = 0 -- ensure cursor is visible immediately after it moves--? print('source keychord')if Show_file_navigator thenendendelseCursor_time = 0 -- ensure cursor is visible immediately after it movesif Focus == 'edit' thenendendelseif 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' thenFocus = 'log_browser'returnendCursor_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, hText.redraw_all(Editor_state)Editor_state.selection1 = {} -- no support for shift drag while we're resizingif Show_log_browser_side thenEditor_state.right = App.screen.width/2 - Margin_rightelseEditor_state.right = App.screen.width-Margin_rightendLog_browser_state.left = App.screen.width/2 + Margin_rightLog_browser_state.right = App.screen.width-Margin_rightEditor_state.width = Editor_state.right-Editor_state.leftText.tweak_screen_top_and_cursor(Editor_state, Editor_state.left, Editor_state.right)--? print('end resize')endlog_new('source') - file deletion: run.lua run.lua
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)endCursor_time = 0 -- ensure cursor is visible immediately after it movesendCursor_time = 0 -- ensure cursor is visible immediately after it movesendCursor_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, hText.redraw_all(Editor_state)Editor_state.selection1 = {} -- no support for shift drag while we're resizingEditor_state.right = App.screen.width-Margin_rightEditor_state.width = Editor_state.right-Editor_state.leftText.tweak_screen_top_and_cursor(Editor_state, Editor_state.left, Editor_state.right)endlog_new('run') - file deletion: log_browser.lua log_browser.lua
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)-- moveif chord == 'up' thenendfunction log_browser.mouse_wheel_move(State, dx,dy)if dy > 0 thenfor i=1,math.floor(dy) dolog_browser.up(State)endlocal line_index = log_browser.line_index(State, x,y)if line_index == nil then-- below lower marginreturnend-- leave some space to click without focusinglocal 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 thenreturnend-- 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 linelocal new_sectionif line.section_begin thenif line_index < #State.lines thenlocal next_section_stack = State.lines[line_index+1].section_stackif next_section_stack thennew_section = next_section_stack[#next_section_stack]endendelseif line.section_end thenif line_index > 1 thenlocal previous_section_stack = State.lines[line_index-1].section_stackif previous_section_stack thennew_section = previous_section_stack[#previous_section_stack]endendendif new_section and new_section.expanded == nil thennew_section.expanded = truereturnendend-- open appropriate file in source sideif line.filename ~= Editor_state.filename thensource.switch_to_file(line.filename)end-- set cursor - replacement in source_text.lua at line 226
function Text.keychord_press(State, chord)function Text.keychord_press(State, chord, key, scancode, is_repeat) - replacement in source_edit.lua at line 235
function edit.mouse_press(State, x,y, mouse_button)function edit.mouse_press(State, x,y, mouse_button, is_touch, presses) - replacement in source_edit.lua at line 282
Drawing.mouse_press(State, line_index, x,y, mouse_button)Drawing.mouse_press(State, line_index, x,y, mouse_button, is_touch, presses) - replacement in source_edit.lua at line 295
function edit.mouse_release(State, x,y, mouse_button)function edit.mouse_release(State, x,y, mouse_button, is_touch, presses) - replacement in source_edit.lua at line 300
Drawing.mouse_release(State, x,y, mouse_button)Drawing.mouse_release(State, x,y, mouse_button, is_touch, presses) - replacement in source_edit.lua at line 386
function edit.keychord_press(State, chord, key)function edit.keychord_press(State, chord, key, scancode, is_repeat) - replacement in source_edit.lua at line 505
Drawing.keychord_press(State, chord)Drawing.keychord_press(State, chord, key, scancode, is_repeat) - replacement in source_edit.lua at line 538
Text.keychord_press(State, chord)Text.keychord_press(State, chord, key, scancode, is_repeat) - replacement in source.lua at line 59
function source.initialize()function source.initialize(arg, unfiltered_arg) - replacement in source.lua at line 176
function source.resize(w, h)function source.resize(w,h) - replacement in source.lua at line 286
function source.mouse_press(x,y, mouse_button)function source.mouse_press(x,y, mouse_button, is_touch, presses) - replacement in source.lua at line 294
edit.mouse_press(Editor_state, x,y, mouse_button)edit.mouse_press(Editor_state, x,y, mouse_button, is_touch, presses) - replacement in source.lua at line 303
edit.mouse_press(Editor_state, x,y, mouse_button)edit.mouse_press(Editor_state, x,y, mouse_button, is_touch, presses) - replacement in source.lua at line 310
log_browser.mouse_press(Log_browser_state, x,y, mouse_button)log_browser.mouse_press(Log_browser_state, x,y, mouse_button, is_touch, presses) - replacement in source.lua at line 314
function source.mouse_release(x,y, mouse_button)function source.mouse_release(x,y, mouse_button, is_touch, presses) - replacement in source.lua at line 317
return edit.mouse_release(Editor_state, x,y, mouse_button)return edit.mouse_release(Editor_state, x,y, mouse_button, is_touch, presses) - replacement in source.lua at line 319
return log_browser.mouse_release(Log_browser_state, x,y, mouse_button)return log_browser.mouse_release(Log_browser_state, x,y, mouse_button, is_touch, presses) - replacement in source.lua at line 345
function source.keychord_press(chord, key)function source.keychord_press(chord, key, scancode, is_repeat) - replacement in source.lua at line 385
return edit.keychord_press(Editor_state, chord, key)return edit.keychord_press(Editor_state, chord, key, scancode, is_repeat) - replacement in source.lua at line 387
return log_browser.keychord_press(Log_browser_state, chord, key)return log_browser.keychord_press(Log_browser_state, chord, key, scancode, is_repeat) - replacement in source.lua at line 396
return log_browser.keychord_press(Log_browser_state, chordkey, scancode)return log_browser.key_release(Log_browser_state, key, scancode) - replacement in run.lua at line 14
function run.initialize(arg)function run.initialize(arg, unfiltered_arg) - replacement in run.lua at line 103
function run.resize(w, h)function run.resize(w,h) - replacement in run.lua at line 169
function run.mouse_press(x,y, mouse_button)function run.mouse_press(x,y, mouse_button, is_touch, presses) - replacement in run.lua at line 172
return edit.mouse_press(Editor_state, x,y, mouse_button)return edit.mouse_press(Editor_state, x,y, mouse_button, is_touch, presses) - replacement in run.lua at line 175
function run.mouse_release(x,y, mouse_button)function run.mouse_release(x,y, mouse_button, is_touch, presses) - replacement in run.lua at line 177
return edit.mouse_release(Editor_state, x,y, mouse_button)return edit.mouse_release(Editor_state, x,y, mouse_button, is_touch, presses) - replacement in run.lua at line 190
function run.keychord_press(chord, key)function run.keychord_press(chord, key, scancode, is_repeat) - replacement in run.lua at line 192
return edit.keychord_press(Editor_state, chord, key)return edit.keychord_press(Editor_state, chord, key, scancode, is_repeat) - replacement in main.lua at line 210
function App.keychord_press(chord, key)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) endif source.mouse_press then source.mouse_press(x,y, mouse_button, is_touch, presses) end - resolve order conflict in main.lua at line 291
- replacement in main.lua at line 296
function App.mousepressed(x,y, mouse_button)function App.mousepressed(x,y, mouse_button, is_touch, presses) - replacement in main.lua at line 300
if run.mouse_press then run.mouse_press(x,y, mouse_button) endif 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) endfunction App.mousereleased(x,y, mouse_button, is_touch, presses)if run.mouse_release then run.mouse_release(x,y, mouse_button, is_touch, presses) endif 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](∅→∅)
elseassert(false, 'unknown app "'..Current_app..'"')endend - resolve order conflict in main.lua at line 302[9.190246]
- edit in main.lua at line 302
if source.mouse_press then source.mouse_press(x,y, mouse_button, is_touch, presses) end - replacement in main.lua at line 308
function App.mousereleased(x,y, mouse_button)function App.mousereleased(x,y, mouse_button, is_touch, presses) - edit in main.lua at line 311
if run.mouse_release then run.mouse_release(x,y, mouse_button) endif run.mouse_move then run.mouse_move(x,y, dx,dy, is_touch) end - resurrect zombie in main.lua at line 311
elseif Current_app == 'source' then - edit in main.lua at line 311
if run.mouse_release then run.mouse_release(x,y, mouse_button, is_touch, presses) end - edit in main.lua at line 313
if source.mouse_release then source.mouse_release(x,y, mouse_button) endif 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](∅→∅)
elseassert(false, 'unknown app "'..Current_app..'"')endend - edit in main.lua at line 313
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
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
if run.mouse_move then run.mouse_move(x,y, dx,dy, is_touch) end - replacement in main.lua at line 324
if source.mouse_move then source.mouse_move(dx,dy) endif source.mouse_move then source.mouse_move(x,y, dx,dy, is_touch) end - edit in main.lua at line 395
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
function log_browser.mouse_press(State, x,y, mouse_button)function log_browser.mouse_press(State, x,y, mouse_button, is_touch, presses) - replacement in log_browser.lua at line 252
function log_browser.mouse_release(State, x,y, mouse_button)function log_browser.mouse_release(State, x,y, mouse_button, is_touch, presses) - replacement in log_browser.lua at line 270
function log_browser.keychord_press(State, chord, key)function log_browser.keychord_press(State, chord, key, scancode, is_repeat) - replacement in edit.lua at line 148
function edit.mouse_press(State, x,y, mouse_button)function edit.mouse_press(State, x,y, mouse_button, is_touch, presses) - replacement in edit.lua at line 193
function edit.mouse_release(State, x,y, mouse_button)function edit.mouse_release(State, x,y, mouse_button, is_touch, presses) - replacement in edit.lua at line 260
function edit.keychord_press(State, chord, key)function edit.keychord_press(State, chord, key, scancode, is_repeat) - replacement in edit.lua at line 370
Text.keychord_press(State, chord)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
pmx,pmy = px(mx), py(my)local shape = drawing.pendingif shape.mode == nil then-- nothing pendingelseif shape.mode == 'freehand' thenlocal shape_copy = deepcopy(shape)Drawing.smoothen(shape_copy)Drawing.draw_shape(drawing, shape_copy, top, left,right)elseif shape.mode == 'line' thenif mx < 0 or mx >= 256 or my < 0 or my >= drawing.h thenreturnendlocal p1 = drawing.points[shape.p1]love.graphics.line(px(p1.x),py(p1.y), pmx,pmy)elseif shape.mode == 'manhattan' thenif mx < 0 or mx >= 256 or my < 0 or my >= drawing.h thenreturnendlocal p1 = drawing.points[shape.p1]if math.abs(mx-p1.x) > math.abs(my-p1.y) thenlove.graphics.line(px(p1.x),py(p1.y), pmx, py(p1.y))elselove.graphics.line(px(p1.x),py(p1.y), px(p1.x),pmy)endelseif shape.mode == 'polygon' then-- don't close the loop on a pending polygonlocal prev = nilfor _,point in ipairs(shape.vertices) dolocal curr = drawing.points[point]if prev thenlove.graphics.line(px(prev.x),py(prev.y), px(curr.x),py(curr.y))endprev = currendlove.graphics.line(px(prev.x),py(prev.y), pmx,pmy)elseif shape.mode == 'rectangle' thenlocal first = drawing.points[shape.vertices[1]]if #shape.vertices == 1 thenlove.graphics.line(px(first.x),py(first.y), pmx,pmy)returnendlocal 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' thenlocal first = drawing.points[shape.vertices[1]]if #shape.vertices == 1 thenlove.graphics.line(px(first.x),py(first.y), pmx,pmy)returnendlocal 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' thenlocal center = drawing.points[shape.center]if mx < 0 or mx >= 256 or my < 0 or my >= drawing.h thenreturnend - resurrect zombie in drawing.lua at line 192
local cx,cy = px(center.x), py(center.y) - resurrect zombie in drawing.lua at line 194
elseif shape.mode == 'arc' thenlocal center = drawing.points[shape.center]if mx < 0 or mx >= 256 or my < 0 or my >= drawing.h thenreturnendshape.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 committedelseif shape.mode == 'name' then-- nothing pending; changes are immediately committedelse - 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](∅→∅)
endend - 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](∅→∅)
endlocal 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)function Drawing.mouse_press(State, drawing_index, x,y, mouse_button, is_touch, presses) - resurrect zombie in drawing.lua at line 227
local cx = Drawing.coord(x-State.left, State.width) - resurrect zombie in drawing.lua at line 229
if State.current_drawing_mode == 'freehand' thendrawing.pending = {mode=State.current_drawing_mode, points={{x=cx, y=cy}}}elseif State.current_drawing_mode == 'line' or State.current_drawing_mode == 'manhattan' thenlocal 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' thenlocal 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' thenlocal 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
elseif State.current_drawing_mode == 'name' then-- nothingelse - resurrect zombie in drawing.lua at line 246
endend-- a couple of operations on drawings need to constantly check the state of the mousefunction Drawing.update(State)if State.lines.current_drawing == nil then return endlocal drawing = State.lines.current_drawing - resurrect zombie in drawing.lua at line 261
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
if App.mouse_down(1) then - resurrect zombie in drawing.lua at line 266
if drawing.pending.mode == 'freehand' thentable.insert(drawing.pending.points, {x=mx, y=my})elseif drawing.pending.mode == 'move' thendrawing.pending.target_point.x = mxdrawing.pending.target_point.y = myDrawing.relax_constraints(drawing, drawing.pending.target_point_index)endendelseif 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 = mxdrawing.pending.target_point.y = myDrawing.relax_constraints(drawing, drawing.pending.target_point_index)endelse-- do nothingendendfunction Drawing.relax_constraints(drawing, p)for _,shape in ipairs(drawing.shapes) doif shape.mode == 'manhattan' thenif shape.p1 == p thenshape.mode = 'line'elseif shape.p2 == p thenshape.mode = 'line'endelseif shape.mode == 'rectangle' or shape.mode == 'square' thenfor _,v in ipairs(shape.vertices) doif v == p thenshape.mode = 'polygon'endendendendendif State.current_drawing_mode == 'move' thenState.current_drawing_mode = State.previous_drawing_modeState.previous_drawing_mode = nilif State.lines.current_drawing thenState.lines.current_drawing.pending = {}State.lines.current_drawing = nilendelseif State.lines.current_drawing thenlocal 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)function Drawing.mouse_release(State, x,y, mouse_button, is_touch, presses) - resurrect zombie in drawing.lua at line 314
if drawing.pending thenif drawing.pending.mode == nil then-- nothing pendingelseif drawing.pending.mode == 'freehand' then-- the last point added during update is good enoughDrawing.smoothen(drawing.pending)table.insert(drawing.shapes, drawing.pending)elseif drawing.pending.mode == 'line' then - resurrect zombie in drawing.lua at line 323
if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h thendrawing.pending.p2 = Drawing.find_or_insert_point(drawing.points, mx,my, State.width)table.insert(drawing.shapes, drawing.pending)endelseif drawing.pending.mode == 'manhattan' thenlocal p1 = drawing.points[drawing.pending.p1] - resurrect zombie in drawing.lua at line 330
if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h thenif math.abs(mx-p1.x) > math.abs(my-p1.y) thendrawing.pending.p2 = Drawing.find_or_insert_point(drawing.points, mx, p1.y, State.width)elsedrawing.pending.p2 = Drawing.find_or_insert_point(drawing.points, p1.x, my, State.width)endlocal p2 = drawing.points[drawing.pending.p2] - resurrect zombie in drawing.lua at line 338
table.insert(drawing.shapes, drawing.pending)endelseif drawing.pending.mode == 'polygon' then - resurrect zombie in drawing.lua at line 342
if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h thentable.insert(drawing.pending.vertices, Drawing.find_or_insert_point(drawing.points, mx,my, State.width))table.insert(drawing.shapes, drawing.pending)endelseif drawing.pending.mode == 'rectangle' then - resurrect zombie in drawing.lua at line 348
if #drawing.pending.vertices == 2 then - resurrect zombie in drawing.lua at line 350
if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h thenlocal 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)endelse-- too few points; draw nothingendelseif drawing.pending.mode == 'square' then - resurrect zombie in drawing.lua at line 363
if #drawing.pending.vertices == 2 then - resurrect zombie in drawing.lua at line 365
if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h thenlocal 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)endendelseif drawing.pending.mode == 'circle' then - resurrect zombie in drawing.lua at line 376
if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h thenlocal center = drawing.points[drawing.pending.center]drawing.pending.radius = round(geom.dist(center.x,center.y, mx,my))table.insert(drawing.shapes, drawing.pending)endelseif drawing.pending.mode == 'arc' then - resurrect zombie in drawing.lua at line 383
if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h thenlocal 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)endelseif drawing.pending.mode == 'name' then-- drop itelse - 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](∅→∅)
endState.lines.current_drawing.pending = {}State.lines.current_drawing = nilendendendif chord == 'C-p' and not App.mouse_down(1) thenState.current_drawing_mode = 'freehand'elseif App.mouse_down(1) and chord == 'l' thenState.current_drawing_mode = 'line'local _,drawing = Drawing.current_drawing(State)if drawing.pending.mode == 'freehand' thendrawing.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' thendrawing.pending.p1 = drawing.pending.vertices[1]elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' thendrawing.pending.p1 = drawing.pending.centerenddrawing.pending.mode = 'line'elseif chord == 'C-l' and not App.mouse_down(1) thenState.current_drawing_mode = 'line'elseif App.mouse_down(1) and chord == 'm' thenState.current_drawing_mode = 'manhattan'local drawing = Drawing.select_drawing_at_mouse(State)if drawing.pending.mode == 'freehand' thendrawing.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 nothingelseif drawing.pending.mode == 'polygon' or drawing.pending.mode == 'rectangle' or drawing.pending.mode == 'square' thendrawing.pending.p1 = drawing.pending.vertices[1]elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' thendrawing.pending.p1 = drawing.pending.centerenddrawing.pending.mode = 'manhattan'elseif chord == 'C-m' and not App.mouse_down(1) thenState.current_drawing_mode = 'manhattan'elseif chord == 'C-g' and not App.mouse_down(1) thenState.current_drawing_mode = 'polygon'elseif App.mouse_down(1) and chord == 'g' thenState.current_drawing_mode = 'polygon'local _,drawing = Drawing.current_drawing(State)if drawing.pending.mode == 'freehand' thendrawing.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' thenif drawing.pending.vertices == nil thendrawing.pending.vertices = {drawing.pending.p1}endelseif drawing.pending.mode == 'rectangle' or drawing.pending.mode == 'square' then-- reuse existing verticeselseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' thendrawing.pending.vertices = {drawing.pending.center}enddrawing.pending.mode = 'polygon'elseif chord == 'C-r' and not App.mouse_down(1) thenState.current_drawing_mode = 'rectangle'elseif App.mouse_down(1) and chord == 'r' thenState.current_drawing_mode = 'rectangle'local _,drawing = Drawing.current_drawing(State)if drawing.pending.mode == 'freehand' thendrawing.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' thenif drawing.pending.vertices == nil thendrawing.pending.vertices = {drawing.pending.p1}endelseif drawing.pending.mode == 'polygon' or drawing.pending.mode == 'square' then-- reuse existing (1-2) verticeselseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' thendrawing.pending.vertices = {drawing.pending.center}enddrawing.pending.mode = 'rectangle'elseif chord == 'C-s' and not App.mouse_down(1) thenState.current_drawing_mode = 'square'elseif App.mouse_down(1) and chord == 's' thenState.current_drawing_mode = 'square'local _,drawing = Drawing.current_drawing(State)if drawing.pending.mode == 'freehand' thendrawing.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' thenif drawing.pending.vertices == nil thendrawing.pending.vertices = {drawing.pending.p1}endelseif drawing.pending.mode == 'polygon' thenwhile #drawing.pending.vertices > 2 dotable.remove(drawing.pending.vertices)endelseif drawing.pending.mode == 'rectangle' then-- reuse existing (1-2) verticeselseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' thendrawing.pending.vertices = {drawing.pending.center}enddrawing.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)function Drawing.keychord_press(State, chord, key, scancode, is_repeat) - resurrect zombie in drawing.lua at line 489
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
local j = Drawing.find_or_insert_point(drawing.points, mx,my, State.width)while #drawing.pending.vertices >= 2 dotable.remove(drawing.pending.vertices)endtable.insert(drawing.pending.vertices, j)elseif chord == 'C-o' and not App.mouse_down(1) thenState.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
drawing.pending.mode = 'arc' - resurrect zombie in drawing.lua at line 507
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' thenState.current_drawing_mode = 'circle'local _,drawing = Drawing.current_drawing(State)if drawing.pending.mode == 'freehand' thendrawing.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' thendrawing.pending.center = drawing.pending.p1elseif drawing.pending.mode == 'polygon' or drawing.pending.mode == 'rectangle' or drawing.pending.mode == 'square' thendrawing.pending.center = drawing.pending.vertices[1]enddrawing.pending.mode = 'circle'elseif chord == 'C-u' and not App.mouse_down(1) then - resurrect zombie in drawing.lua at line 523
if drawing thenif State.previous_drawing_mode == nil thenState.previous_drawing_mode = State.current_drawing_modeendState.current_drawing_mode = 'move'drawing.pending = {mode=State.current_drawing_mode, target_point=p, target_point_index=i}State.lines.current_drawing_index = drawing_indexState.lines.current_drawing = drawingendelseif chord == 'C-n' and not App.mouse_down(1) then - resurrect zombie in drawing.lua at line 534
if drawing thenif State.previous_drawing_mode == nil then-- don't clobberState.previous_drawing_mode = State.current_drawing_modeendState.current_drawing_mode = 'name'p.name = ''drawing.pending = {mode=State.current_drawing_mode, target_point=point_index}State.lines.current_drawing_index = drawing_indexState.lines.current_drawing = drawingendelseif chord == 'C-d' and not App.mouse_down(1) thenlocal _,drawing,_,i,p = Drawing.select_point_at_mouse(State)if drawing thenfor _,shape in ipairs(drawing.shapes) doif Drawing.contains_point(shape, i) thenif shape.mode == 'polygon' thenlocal idx = table.find(shape.vertices, i) - resurrect zombie in drawing.lua at line 553
table.remove(shape.vertices, idx)if #shape.vertices < 3 thenshape.mode = 'deleted'endelseshape.mode = 'deleted'endendenddrawing.points[i].deleted = trueendlocal drawing,_,_,shape = Drawing.select_shape_at_mouse(State)if drawing thenshape.mode = 'deleted'endelseif chord == 'C-h' and not App.mouse_down(1) thenlocal drawing = Drawing.select_drawing_at_mouse(State)if drawing thendrawing.show_help = trueendelseif chord == 'escape' and App.mouse_down(1) thenlocal _,drawing = Drawing.current_drawing(State)drawing.pending = {}endendfunction Drawing.complete_rectangle(firstx,firsty, secondx,secondy, x,y)if firstx == secondx thenreturn x,secondy, x,firstyendif firsty == secondy thenreturn secondx,y, firstx,yendlocal 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_equationlocal a = 1/first_slopelocal c = -secondy - secondx/first_slopelocal 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 pointlocal a = -first_slopelocal c = -thirdy + thirdx*first_slopelocal 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,fourthyendfunction 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 onlocal deltax = secondx-firstxlocal deltay = secondy-firstylocal thirdx = secondx+deltaylocal thirdy = secondy-deltaxif not geom.same_side(firstx,firsty, secondx,secondy, thirdx,thirdy, x,y) thendeltax = -deltaxdeltay = -deltaythirdx = secondx+deltaythirdy = secondy-deltaxendlocal fourthx = firstx+deltaylocal fourthy = firsty-deltaxreturn thirdx,thirdy, fourthx,fourthyendfunction Drawing.current_drawing(State)local x, y = App.mouse_x(), App.mouse_y()for drawing_index,drawing in ipairs(State.lines) doif drawing.mode == 'drawing' then - resurrect zombie in drawing.lua at line 633
endendendreturn nilendfunction Drawing.select_shape_at_mouse(State)for drawing_index,drawing in ipairs(State.lines) doif drawing.mode == 'drawing' thenlocal 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) doif geom.on_shape(mx,my, drawing, shape) then - resurrect zombie in drawing.lua at line 649
endendendendendendfunction Drawing.select_point_at_mouse(State)for drawing_index,drawing in ipairs(State.lines) doif drawing.mode == 'drawing' thenlocal 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) doif Drawing.near(point, mx,my, State.width) then - resurrect zombie in drawing.lua at line 666
endendendendendendfunction Drawing.select_drawing_at_mouse(State)for drawing_index,drawing in ipairs(State.lines) doif drawing.mode == 'drawing' thenlocal x, y = App.mouse_x(), App.mouse_y() - resurrect zombie in drawing.lua at line 678
return drawingendendendendfunction Drawing.contains_point(shape, p)if shape.mode == 'freehand' then-- not supportedelseif shape.mode == 'line' or shape.mode == 'manhattan' thenreturn shape.p1 == p or shape.p2 == pelseif shape.mode == 'polygon' or shape.mode == 'rectangle' or shape.mode == 'square' thenreturn table.find(shape.vertices, p)elseif shape.mode == 'circle' thenreturn shape.center == pelseif shape.mode == 'arc' thenreturn shape.center == p-- ugh, how to support angleselseif shape.mode == 'deleted' then-- already doneelse - resurrect zombie in drawing.lua at line 700
endendfunction Drawing.smoothen(shape) - resurrect zombie in drawing.lua at line 705
for _=1,7 dofor i=2,#shape.points-1 dolocal 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)endendendfunction round(num)return math.floor(num+.5)endfunction Drawing.find_or_insert_point(points, x,y, width)-- check if UI would snap the two points togetherfor i,point in ipairs(points) doif Drawing.near(point, x,y, width) thenreturn iendendtable.insert(points, {x=x, y=y})return #pointsendfunction 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_distanceendfunction Drawing.pixels(n, width) -- parts to pixelsreturn math.floor(n*width/256)endfunction Drawing.coord(n, width) -- pixels to partsreturn math.floor(n*256/width)endfunction table.find(h, x)for k,v in pairs(h) doif v == x thenreturn kendendend - 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]