Merge upstream into main
[?]
Jun 20, 2022, 8:42 PM
27DROQW2CHKBMWQCCR7N7VK54P3HE7MESZIJSJ32JTPKEE23WJPACDependencies
- [2]
BW6YXB6Wstop recording points for arcs - [3]
HHW3B3WF. - [4]
DDXXXXBRnew mode for polygons - [5]
NONKKVVPupdate Readme for this fork - [6]
SDVBZT66tailor some copy to this fork - [7]
BPL2TDWHdocument one more shortcut - [8]
4PHDQ5L5correct commit f3abc2cbf2 - [9]
WCU5H2FEclean up - [10]
7XKWT5Y5correct location of the line width slider - [11]
23DEB6JLmake sure to save right when quitting - [12]
GXEM6FP6typos - [13]
CZB4CK2Rbugfix - [14]
BU3U7TIJclearer copy - [15]
NVSWVPW5move - [16]
NUCZBE77bugfix: alignment of help screen - [17]
IEHG6OROnew fork for #1 - [18]
UEE5W7WJdocument one more shortcut - [19]
LYN3L74Wcorrect commit f3abc2cbf2 - [20]
WPW3AVFSmore precise shape selection - [21]
BZRRUIFQcorrect location of the line width slider - [22]
VIU2FBNVmake sure to save right when quitting - [23]
KICO5EE5typos - [24]
AVLAYODPmuch simpler - [25]
QZH3PQFU. - [26]
RTDYYP4Hbugfix: text past cursor was rendered red on wrapped lines - [27]
B4YZWV6Sbugfix: checking if a point is on a manhattan line - [28]
5DOC2CBMextract a function - [29]
NP7PIUBTbugfix: restore state after C-f (find) - [30]
ZLJGZYQGselect text with shift + mouseclick - [31]
42LVB4DEtest: naming a point - [32]
MDXGMZU2disable all debug prints - [33]
6UZ2JNZEyet another key conflict - [34]
7CLGG7J2test: autosave after any shape - [35]
W7JMT5V2rip out most support for polygons - [36]
JY4VK7L2rename - [37]
V366JSXAvideos - [38]
4C375P53this is a bit clearer - [39]
DGK5BPVIbugfix: UTF-8 in compute_fragments - [40]
SHEGBK4Hwhile we're at it, undo naming points - [41]
242L3OQXbugfix: ensure Cursor_line is always on a text line - [42]
OAHNWDYG. - [43]
7DYUAOI6test: undo moving point - [44]
66X36NZNa little more prose describing manual_tests - [45]
RSZD5A7Gforgot to add json.lua - [46]
KAUD3YIKtests: deleting points/shapes - [47]
XX7G2FFJintermingle freehand line drawings with text - [48]
TLOAPLBJadd a license - [49]
DXT4QTAHa few more integer coordinates - [50]
BOFNXP5Gclicking now moves the cursor even on long, wrapped lines - [51]
CUIV2LE5some typos - [52]
IRCKL6VNextract scrolling logic out of insert_at_cursor - [53]
UGYRO7TOforgot to commit documentation for the commandline arg - [54]
SR7L4QPZrevert previous commit - [55]
DLQMM265scroll past first page - [56]
7IKRRESBlonger names for indices in long loops - [57]
HYEAFRZ2split mouse_pressed events between Text and Drawing - [58]
GY6LTMIJmore precise shape selection - [59]
BERHYBXMfix help for rectangles and squares - [60]
ESETRNLBbugfix: printing the first part of a line at the bottom made it seem non-wrapping - [61]
L6XA5EY2test: moving a point - [62]
3ZYCPNQYclearer copy - [63]
6DE7RBZ6move mouse_released events to Drawing - [64]
WTDKUACNrectangle and square shapes - [65]
LXTTOB33extract a couple of files - [66]
GN3IF4WFbugfix: pasting newlines - [67]
65XHTZEKregression: couldn't do many drawing operations because line.y was reset - [68]
3GFQP6IRstop saving the entire file when modifying drawings - [69]
4ZM74KYLindent - [70]
NFCBIEZDaffordance to adjust width for word wrap - [71]
CE4LZV4Tdrop last couple of manual tests - [72]
VG75U7IMbugfix: typing should delete highlighted text - [73]
XOAHJ6M3similar tests for cursor up - [74]
F63Q4OV7several bugfixes - [75]
7OUJM7DLone missing transition between shape modes - [76]
FHSZYAZ2more precise search highlighting - [77]
SRVDX4I5local var - [78]
BYG5CEMVsupport for naming points - [79]
B3IWYWSRdelete another arg that can be deduced - [80]
CPZGQT72go through and fix similar issues - [81]
WIPDCP4Ustop recording points for arcs - [82]
7M5PGWKUdrop last couple of manual tests - [83]
CG3264MMmove - [84]
2ZYV7D3Whandle tab characters - [85]
OWK3U6VDtests for drawing polygons - [86]
R5QXEHUIsomebody stop me - [87]
EQP53UQVautosave slightly less aggressively - [88]
AOIRVVJArevert selection logic to before commit 3ffc2ed8f - [89]
ULKLJBN6couple of renames - [90]
QKAMUWSBanother bugfix in scrolling while inserting text - [91]
YKRF5V3Zstarting to load/save - [92]
U7M4M2F7bugfix: don't rely on Screen_bottom1 while scrolling - [93]
HIKLULFQextract a function - [94]
T7IWZFL4more precise scroll on paste - [95]
4VKEE43Zbugfix - [96]
73OCE2MCafter much struggle, a brute-force undo - [97]
K2X6G75Zstart writing some tests for drawings - [98]
4YDBYBA4clean up memory leak experiments - [99]
NQWWTGXRswitch undo/redo to ctrl- hotkeys - [100]
2RXZ3PGObeginning of a new approach to scroll+wrap - [101]
VXORMHMEdelete experimental REPL - [102]
CZRMAMSBclearer discription of how to run lines.love - [103]
U76D4P36fix a typo - [104]
ZUOL7X6Vmove - [105]
BLWAYPKVextract a module - [106]
TVCPXAAUrename - [107]
AYE2VEGJextract a couple of methods - [108]
CRYGI3LRmore drawing tests - [109]
6LJZN727handle chords - [110]
NEXUNNCFextract a function - [111]
T7SJSJIHtest: undo naming a point - [112]
YHB3IX5Otweak to Readme - [113]
ZRKTXF4Qtweak to Readme - [114]
EMHRPJ3Rno, that's not right - [115]
OYXDYPGSget rid of debug variables - [116]
K464QQR4more defensive resize handling - [117]
D2GCFTTTclean up repl functionality - [118]
IDGP4BJZnew known issue with drawings - [119]
LGD2F7UVbetter handle moving points - [120]
DRFE3B3Zmouse buttons are integers, not strings - [121]
PR4KIAZDfirst stab at equally hacky cursor down support - [122]
LAW2O3NWextract variable Margin_left - [123]
4MXCZQ6Enew icon for polygons - [124]
FYS7TCDWbugfix - [125]
253TWKDAclean up - [126]
MGOQ5XAVstart uppercasing globals - [127]
T4FRZSYLdelete an ancient, unused file - [128]
PFT5Y2ZYmove - [129]
HOSPP2ANcrisp font rendering - [130]
XHGO5TGMswitch lines to digit shortcuts as well - [131]
AVFRVNFRbetter handle moving points - [132]
537TQ2QNsome more logging - [133]
IMEJA43Lsnapshot - [134]
H2DPLWMVsnapshot: wrapping long lines at word boundaries - [135]
SQLVYKVJrename - [136]
6LIPEQ5Imore robust transitions to temporary modes - [137]
JF5L2BBStest harness now supports copy/paste - [138]
AJB4LFRBtry to maintain a reasonable line width - [139]
6VQIWTQUstandardize on ordering of cases - [140]
OLZRJ4AXexperiment: use digits to draw regular polygons - [141]
RF5ALVNYallow the window to be resized - [142]
2ENZW7TVselect text using mouse drag - [143]
3TFEAQSWstart using some globals - [144]
YW2GO3U4bugfix: crash in Text.up() after return - [145]
4WAFGF4Zselection bugfix - [146]
AVTNUQYRbasic test-enabled framework - [147]
J2SVGR2Eexperiment: blinking cursor - [148]
Z4XRNDTRfind text - [149]
3QNOKBFMbeginnings of a test harness - [150]
BTKAW76Lrename - [151]
5BJCYYHNconvert videos to gif so they render inline on GitHub - [152]
IDG26SXKbugfix in commit e51ce12969 - [153]
2POFQQLWkeep cursor on screen when pressing 'down' - [154]
VJ77YABHmore efficient undo/redo - [155]
3TTAYXPPcleanup - [156]
YW5324Q3bugfix: cut (C-x) without first selecting anything - [157]
KEPVDTCG. - [158]
BU3LUPY3bugfix in help - [159]
DHCLUDCW. - [160]
RMKMPFT5fix a corner case when selecting text - [161]
WSXSEZQ2switch circles to 'o' to avoid conflicting with copy - [162]
PX7DDEMOautosave slightly less aggressively - [163]
DHI6IJCNselecting text and deleting selections - [164]
LS55YKGWswitch copy/paste to ctrl- hotkeys - [165]
3TDOZESEextract scrolling logic out of insert_return - [166]
4AXV2HG4all pending manual tests done! - [167]
DAENUOGVeliminate assumptions that line length == size in bytes - [168]
5L7K4GBDclicking to the right of a wrapped line - [169]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [170]
RT6EV6OPdelegate update events to drawings - [171]
4J2WLDRMindent - [172]
YTSPVDZHfirst successful pagedown test, first bug found by test - [173]
OTIBCAUJlove2d scaffold - [174]
ZPUQSPQPextract a few methods - [175]
JCSLDGAHbeginnings of support for multiple shapes - [176]
KVHUFUFVreorg - [177]
GSV7DABCmake online help fit within a drawing - [178]
JZKEIKO6freudian typo - [179]
NQKFQSZEundo creating new drawings - [180]
VC2CU2GGfaster paste - [181]
VHQCNMARseveral more modules - [182]
TVM2WIHHbugfix: autosave and undo in a couple of cases - [183]
JRLBUB6Lmore intuitive point delete from polygons - [184]
UWNHC4AAredo y computations - [185]
NQH7DEEWbugfix: missed rename in one file - [186]
V5MJRFOZbugfix: down arrow doesn't scroll up unnecessarily - [187]
CCYSVZA2bugfix: BSOD in #4. - [188]
SLLR6KKIbugfix for non-ASCII - [189]
D4FEFHQCflesh out Readme - [190]
VA2ZYFFFbetter fix for commit 3ffc2ed8f - [191]
IHHNPJ5Qmove - [192]
SGMDI4TCbugfix: alignment of help screen - [193]
NZKYPBSKcheck for scroll when just typing - [194]
SN2QONLIautosave on cut/paste - [195]
FS2ITYYHrecord a known issue - [196]
XSLCFVFH. - [197]
JFFUF5ALoverride mouse state lookups in tests - [198]
3OKKTUT4up and down arrow now moving by screen line where possible - [199]
JAXPXLEBset current_drawing_index with current_drawing - [200]
DR5XD5JQper-polygon icons - [201]
6J3NXBYGaffordance to adjust width for word wrap - [202]
2MA33THZfew more transitions between shapes - [203]
MP2TBKU6bugfix: crash in Text.up() after return - [204]
2INHXC3Kposition cursor by clicking on text - [205]
WDMPH4ANdrop support for squares - [206]
XVR2O5PIchange text cursor shape - [207]
WIDXZBNWexperiment: extremely precise scrolling on paste - [208]
BULPIBEGbeginnings of a module for the text editor - [209]
F3OOGMMEswitch freehand hotkey to eliminate conflict with search - [210]
OGUV4HSAremove some memory leaks from rendered fragments - [211]
HRWN5V6JDevine's suggestion to try to live with just freehand - [212]
UFIUYYYVadditional logging for an active bug - [213]
YCDYGEZUinclude drawing index in a few places - [214]
PGZJ6NATensure Filename is writable when opened outside a terminal - [215]
AD34IX2Zcouple more tests - [216]
XNFTJHC4split keyboard handling between Text and Drawing - [217]
Y4VYNEGFtest: autosave after name/move/delete of point
Change contents
- file deletion: main_tests.lua
function test_resize_window()io.write('\ntest_resize_window')Filename = 'foo'App.screen.init{width=Margin_left+300, height=300}check_eq(App.screen.width, Margin_left+300, 'F - test_resize_window/baseline/width')check_eq(App.screen.height, 300, 'F - test_resize_window/baseline/height')App.resize(200, 400)check_eq(App.screen.width, 200, 'F - test_resize_window/width')check_eq(App.screen.height, 400, 'F - test_resize_window/height')-- TODO: how to make assertions about when App.update got past the early exit?endfunction test_adjust_line_width()io.write('\ntest_adjust_line_width')Filename = 'foo'App.screen.init{width=Margin_left+300, height=300}Line_width = 256App.draw() -- initialize button-- no change for some timeApp.wait_fake_time(0.01)App.update(0)check_eq(Line_width, 256, 'F - test_adjust_line_width/early')-- after 0.1s the change takesApp.wait_fake_time(0.1)App.update(0)check_eq(Line_width, 200, 'F - test_adjust_line_width')endApp.run_after_mouse_press(256, Margin_top-3, 1)App.mouse_move(200, 37) - edit in text_tests.lua at line 189
function test_edit_after_click_resets_selection()io.write('\ntest_edit_after_click_resets_selection')-- display a line of textApp.screen.init{width=80, height=80}Lines = load_array{'abc'}Line_width = 75Cursor1 = {line=1, pos=1}Screen_top1 = {line=1, pos=1}Screen_bottom1 = {}App.draw()-- click past the end of it and hit enterApp.run_after_mouse_click(Margin_left+40,Margin_top+5, 1)check(Selection1.line, 'F - test_edit_after_click_resets_selection/baseline')App.run_after_keychord('return')-- selection is reset since shift key is not pressedcheck_nil(Selection1.line, 'F - test_edit_after_click_resets_selection')end - resolve order conflict in text_tests.lua at line 189
- edit in text.lua at line 17
--? love.graphics.line(Line_width,0, Line_width,App.screen.height) - edit in text.lua at line 117
local boffset = Text.offset(frag, bpos+1) -- byte _after_ bpos - resolve order conflict in text.lua at line 117
- edit in text.lua at line 160
local byte_offset = Text.offset(Lines[Cursor1.line].data, Cursor1.pos) - edit in text.lua at line 169
--? print('chord', chord, Selection1.line, Selection1.pos) - edit in text.lua at line 180
schedule_save() - resolve order conflict in text.lua at line 180
- edit in text.lua at line 191
schedule_save() - resolve order conflict in text.lua at line 191
- edit in text.lua at line 195
schedule_save() - edit in text.lua at line 233
schedule_save() - resolve order conflict in text.lua at line 233
- edit in text.lua at line 238
schedule_save() - resolve order conflict in text.lua at line 238
- edit in text.lua at line 268
schedule_save() - edit in text.lua at line 354
local byte_offset = Text.offset(Lines[Cursor1.line].data, Cursor1.pos) - edit in text.lua at line 436
local screen_line_starting_byte_offset = Text.offset(Lines[Cursor1.line].data, screen_line_starting_pos) - edit in text.lua at line 456
local new_screen_line_starting_byte_offset = Text.offset(Lines[Cursor1.line].data, new_screen_line_starting_pos) - resolve order conflict in text.lua at line 456
- edit in text.lua at line 494
local new_screen_line_starting_byte_offset = Text.offset(Lines[Cursor1.line].data, new_screen_line_starting_pos) - edit in text.lua at line 512
local offset = Text.offset(Lines[Cursor1.line].data, Cursor1.pos) - edit in text.lua at line 525
local offset = Text.offset(Lines[Cursor1.line].data, Cursor1.pos) - resolve order conflict in text.lua at line 525
- edit in text.lua at line 665
local screen_line_starting_byte_offset = Text.offset(line.data, screen_line_starting_pos) - resolve order conflict in text.lua at line 665
- edit in text.lua at line 770
local offset = Text.offset(s, pos) - resolve order conflict in text.lua at line 770
- resolve order conflict in text.lua at line 834
- edit in text.lua at line 836[25.880]→[25.880:1157](∅→∅),[25.1157]→[25.559:564](∅→∅),[25.1157]→[25.559:564](∅→∅),[25.559]→[25.559:564](∅→∅)
function Text.offset(s, pos1)if pos1 == 1 then return 1 endlocal result = utf8.offset(s, pos1)if result == nil thenprint(Cursor1.line, Cursor1.pos, #Lines[Cursor1.line].data, Lines[Cursor1.line].data)print(pos1, #s, s)endassert(result)return resultend - edit in select.lua at line 58
local lo_offset = Text.offset(line.data, lo)local hi_offset = Text.offset(line.data, hi)local pos_offset = Text.offset(line.data, pos) - edit in select.lua at line 140
local min_offset = Text.offset(Lines[minl].data, minp)local max_offset = Text.offset(Lines[maxl].data, maxp) - edit in select.lua at line 168
local min_offset = Text.offset(Lines[minl].data, minp)local max_offset = Text.offset(Lines[maxl].data, maxp) - edit in main.lua at line 14
require 'main_tests' - edit in main.lua at line 84
Next_save = nil - resolve order conflict in main.lua at line 84
- resolve order conflict in main.lua at line 102
- edit in main.lua at line 103[25.8]→[25.8:55](∅→∅),[25.55]→[25.8163:8164](∅→∅),[25.55]→[25.8163:8164](∅→∅),[25.196]→[25.8163:8164](∅→∅),[25.240]→[25.8163:8164](∅→∅),[25.455]→[25.8163:8164](∅→∅),[25.2017]→[25.8163:8164](∅→∅),[25.2680]→[25.8163:8164](∅→∅),[25.8163]→[25.8163:8164](∅→∅)
-- line-width indicatorLine_width_hover = nil - edit in main.lua at line 174
function App.resize(w, h) - edit in main.lua at line 180
Last_resize_time = App.getTime() - resolve order conflict in main.lua at line 180
- edit in main.lua at line 219
if App.getTime() - Last_resize_time < 0.1 then - edit in main.lua at line 225[25.447]→[25.447:448](∅→∅),[25.448]→[25.56:82](∅→∅),[25.82]→[10.155:237](∅→∅),[10.237]→[25.176:273](∅→∅),[25.176]→[25.176:273](∅→∅)
-- line-width indicatorbutton('line-width', {x=Line_width-4,y=Margin_top-10, w=10,h=10, color={1,1,1},icon = icon.line_width,onpress1 = function() Line_width_hover = App.getTime() end,}) - resolve order conflict in main.lua at line 226
- edit in main.lua at line 245
-- insert new drawing - resolve order conflict in main.lua at line 245
- edit in main.lua at line 254
schedule_save() - resolve order conflict in main.lua at line 254
- edit in main.lua at line 255[25.394]→[25.306:342](∅→∅),[25.342]→[25.7:132](∅→∅),[25.1175]→[25.7:132](∅→∅),[25.1175]→[25.7:132](∅→∅)
end})if Search_term == nil thenif line_index == Cursor1.line thenText.draw_cursor(Margin_left, y) - resurrect zombie in main.lua at line 255[25.394]→[25.306:342](∅→∅),[25.394]→[25.306:342](∅→∅),[25.342]→[25.7:132](∅→∅),[25.1175]→[25.7:132](∅→∅),[25.1175]→[25.7:132](∅→∅)
end})if Search_term == nil thenif line_index == Cursor1.line thenText.draw_cursor(Margin_left, y) - edit in main.lua at line 262
end - resolve order conflict in main.lua at line 262
- edit in main.lua at line 291
if App.getTime() - Last_resize_time < 0.1 then - edit in main.lua at line 295[25.621]→[25.343:510](∅→∅),[25.510]→[10.238:271](∅→∅),[10.271]→[25.557:706](∅→∅),[25.557]→[25.557:706](∅→∅)
endend-- update Line_width with some hysteresis while the indicator is draggedif Line_width_hover thenif App.getTime() - Line_width_hover > 0.1 thenLine_width = App.mouse_x()Text.redraw_all()if App.mouse_down(1) thenLine_width_hover = App.getTime()elseLine_width_hover = nilend - edit in main.lua at line 310
if Next_save and Next_save < App.getTime() thensave_to_disk(Lines, Filename)Next_save = nilend - edit in main.lua at line 327
function schedule_save()if Next_save == nil thenNext_save = App.getTime() + 3 -- short enough that you're likely to still remember what you didendend-- make sure to save before quittingfunction love.quit()save_to_disk(Lines, Filename)end - resolve order conflict in main.lua at line 327
- edit in main.lua at line 336
-- we seem to sometimes get phantom clicks if the mouse moves down into text while adjusting line-widthif Line_width_hover thenSelection1 = {}returnend - resolve order conflict in main.lua at line 336
- edit in main.lua at line 353
--? print('selection') - resolve order conflict in main.lua at line 353
- edit in main.lua at line 370
schedule_save() - resolve order conflict in main.lua at line 370
- edit in main.lua at line 378
--? print('reset selection') - edit in main.lua at line 412
if not App.shift_down() thenSelection1 = {}endschedule_save() - resolve order conflict in main.lua at line 412
- edit in main.lua at line 430
local byte_offset = Text.offset(Search_term, len) - resolve order conflict in main.lua at line 430
- edit in main.lua at line 462
schedule_save() - edit in main.lua at line 474
schedule_save() - edit in main.lua at line 489
schedule_save() - edit in main.lua at line 510
schedule_save() - resolve order conflict in main.lua at line 510
- edit in main.lua at line 520
schedule_save() - resolve order conflict in main.lua at line 520
- edit in main.lua at line 545
local byte_offset = Text.offset(p.name, len-1) - edit in main.lua at line 550
schedule_save() - edit in main.lua at line 555[13.874]→[13.874:925](∅→∅),[24.293]→[25.350:356](∅→∅),[13.925]→[25.350:356](∅→∅),[25.925]→[25.350:356](∅→∅),[25.5055]→[25.350:356](∅→∅),[25.350]→[25.350:356](∅→∅)
if not App.shift_down() thenSelection1 = {}end - resolve order conflict in icons.lua at line 16
- edit in icons.lua at line 17[25.882]→[25.882:1345](∅→∅),[25.1345]→[25.5334:5335](∅→∅),[25.1345]→[25.5334:5335](∅→∅),[25.5334]→[25.5334:5335](∅→∅)
function icon.line_width(x, y)love.graphics.setColor(0.7,0.7,0.7)love.graphics.line(x+0,y+0, x+9,y+0)love.graphics.line(x+0,y+1, x+9,y+1)love.graphics.line(x+0,y+2, x+9,y+2)love.graphics.line(x+0,y+3, x+9,y+3)love.graphics.line(x+0,y+4, x+9,y+4)love.graphics.line(x+0,y+5, x+9,y+5)love.graphics.line(x+1,y+6, x+8,y+6)love.graphics.line(x+2,y+7, x+7,y+7)love.graphics.line(x+3,y+8, x+6,y+8)love.graphics.line(x+4,y+9, x+5,y+9)end - edit in help.lua at line 5
love.graphics.print("Things you can do:", Margin_left+30,y) - resolve order conflict in help.lua at line 5
- edit in help.lua at line 6
love.graphics.print("* Press the mouse button to start drawing a "..current_shape(), Margin_left+30,y) - edit in help.lua at line 9
love.graphics.print("* Hover on a point and press 'ctrl+u' to pick it up and start moving it,", Margin_left+30,y) - resolve order conflict in help.lua at line 9
- edit in help.lua at line 11
love.graphics.print("then press the mouse button to drop it", Margin_left+30+bullet_indent(),y) - resolve order conflict in help.lua at line 11
- edit in help.lua at line 12
love.graphics.print("* Hover on a point and press 'ctrl+n', type a name, then press 'enter'", Margin_left+30,y) - edit in help.lua at line 15
love.graphics.print("* Hover on a point or shape and press 'ctrl+d' to delete it", Margin_left+30,y) - resolve order conflict in help.lua at line 15
- edit in help.lua at line 18
love.graphics.print("* Press 'ctrl+p' to switch to drawing freehand strokes", Margin_left+30,y) - resolve order conflict in help.lua at line 18
- edit in help.lua at line 22
love.graphics.print("* Press 'ctrl+l' to switch to drawing lines", Margin_left+30,y) - resolve order conflict in help.lua at line 22
- edit in help.lua at line 26
love.graphics.print("* Press 'ctrl+m' to switch to drawing horizontal/vertical lines", Margin_left+30,y) - resolve order conflict in help.lua at line 26
- edit in help.lua at line 29
love.graphics.print("* Press 'ctrl+o' to switch to drawing circles/arcs", Margin_left+30,y) - edit in help.lua at line 34
love.graphics.print("* Press 'ctrl+g' to switch to drawing polygons", Margin_left+30,y) - resolve order conflict in help.lua at line 34
- edit in help.lua at line 38
love.graphics.print("* Press 'ctrl+r' to switch to drawing rectangles", Margin_left+30,y) - resolve order conflict in help.lua at line 38
- edit in help.lua at line 41[25.635]→[16.1201:1292](∅→∅),[25.635]→[16.1201:1292](∅→∅),[25.8121]→[16.1293:1405](∅→∅),[25.8121]→[16.1293:1405](∅→∅)
love.graphics.print("* Press 'ctrl+s' to switch to drawing squares", Margin_left+30,y)love.graphics.print("* Press 'ctrl+=' or 'ctrl+-' to zoom in or out, ctrl+0 to reset zoom", Margin_left+30,y) - resolve order conflict in help.lua at line 41
- edit in help.lua at line 42
love.graphics.print("Press 'esc' now to hide this message", Margin_left+30,y) - edit in help.lua at line 45
love.graphics.rectangle('fill', Margin_left,drawing.y, Line_width, math.max(Drawing.pixels(drawing.h),y-drawing.y)) - edit in help.lua at line 52
love.graphics.print("You're currently drawing a "..current_shape(drawing.pending), Margin_left+30,y) - resolve order conflict in help.lua at line 52
- edit in help.lua at line 54
love.graphics.print('Things you can do now:', Margin_left+30,y) - resolve order conflict in help.lua at line 54
- edit in help.lua at line 57
love.graphics.print('* Release the mouse button to finish drawing the stroke', Margin_left+30,y) - resolve order conflict in help.lua at line 57
- edit in help.lua at line 60
love.graphics.print('* Release the mouse button to finish drawing the line', Margin_left+30,y) - resolve order conflict in help.lua at line 60
- edit in help.lua at line 63
love.graphics.print('* Release the mouse button to finish drawing the circle', Margin_left+30,y) - edit in help.lua at line 66
love.graphics.print("* Press 'a' to draw just an arc of a circle", Margin_left+30,y) - resolve order conflict in help.lua at line 66
- edit in help.lua at line 68
love.graphics.print('* Release the mouse button to finish drawing the arc', Margin_left+30,y) - resolve order conflict in help.lua at line 68
- edit in help.lua at line 72[25.9744]→[16.2276:2378](∅→∅),[25.9744]→[16.2276:2378](∅→∅),[25.7536]→[16.2379:2467](∅→∅),[25.7536]→[16.2379:2467](∅→∅)
love.graphics.print('* Release the mouse button to finish drawing the polygon', Margin_left+30,y)love.graphics.print("* Press 'p' to add a vertex to the polygon", Margin_left+30,y) - resolve order conflict in help.lua at line 72
- edit in help.lua at line 83[25.7639]→[25.12:363](∅→∅),[25.363]→[23.12:117](∅→∅),[23.117]→[25.469:845](∅→∅),[25.469]→[25.469:845](∅→∅),[25.845]→[23.118:220](∅→∅),[23.220]→[25.948:982](∅→∅),[25.948]→[25.948:982](∅→∅)
elseif Current_drawing_mode == 'rectangle' thenif #drawing.pending.vertices < 2 thenlove.graphics.print("* Press 'p' to add a vertex to the rectangle", Margin_left+30,y)y = y + Line_heightelselove.graphics.print('* Release the mouse button to finish drawing the rectangle', Margin_left+30,y)y = y + Line_heightlove.graphics.print("* Press 'p' to replace the second vertex of the rectangle", Margin_left+30,y)y = y + Line_heightendelseif Current_drawing_mode == 'square' thenif #drawing.pending.vertices < 2 thenlove.graphics.print("* Press 'p' to add a vertex to the square", Margin_left+30,y)y = y + Line_heightelselove.graphics.print('* Release the mouse button to finish drawing the square', Margin_left+30,y)y = y + Line_heightlove.graphics.print("* Press 'p' to replace the second vertex of the square", Margin_left+30,y)y = y + Line_heightend - resolve order conflict in help.lua at line 83
- edit in help.lua at line 85
love.graphics.print("* Press 'esc' then release the mouse button to cancel the current shape", Margin_left+30,y) - resolve order conflict in help.lua at line 85
- edit in help.lua at line 89
love.graphics.print("* Press 'l' to switch to drawing lines", Margin_left+30,y) - resolve order conflict in help.lua at line 89
- edit in help.lua at line 94
love.graphics.print("* Press 'm' to switch to drawing horizontal/vertical lines", Margin_left+30,y) - edit in help.lua at line 99
love.graphics.print("* Press 'o' to switch to drawing circles/arcs", Margin_left+30,y) - resolve order conflict in help.lua at line 99
- edit in help.lua at line 101
love.graphics.print("* Press 'g' to switch to drawing polygons", Margin_left+30,y) - edit in help.lua at line 102
love.graphics.print("* Press 'r' to switch to drawing rectangles", Margin_left+30,y) - edit in help.lua at line 105
love.graphics.print("* Press 's' to switch to drawing squares", Margin_left+30,y) - edit in help.lua at line 106
love.graphics.rectangle('fill', Margin_left,drawing.y, Line_width, math.max(Drawing.pixels(drawing.h),y-drawing.y)) - edit in geom.lua at line 3
- resolve order conflict in geom.lua at line 3
- edit in geom.lua at line 17
return y >= y1-2 and y <= y2+2 - edit in geom.lua at line 25
return x >= x1-2 and x <= x2+2 - resolve order conflict in geom.lua at line 25
- edit in geom.lua at line 33
local dist = geom.dist(center.x,center.y, x,y)return dist > shape.radius*0.95 and dist < shape.radius*1.05 - edit in geom.lua at line 73
if math.abs(p1.x-x) > 2 then - resolve order conflict in geom.lua at line 73
- edit in geom.lua at line 79
return y >= y1-2 and y <= y2+2 - edit in geom.lua at line 84
if yp < y-2 or yp > y+2 then - edit in geom.lua at line 89
return k > -0.005 and k < 1.005 - edit in drawing_tests.lua at line 13
-- file not immediately savedApp.update(0.01)check_nil(App.filesystem['foo'], 'F - test_creating_drawing_saves/early')-- wait until saveApp.wait_fake_time(3.1)App.update(0) - edit in drawing_tests.lua at line 50
-- wait until saveApp.wait_fake_time(3.1)App.update(0) - edit in drawing_tests.lua at line 188
check_eq(#drawing.points, 1, 'F - test_draw_arc/#points') - edit in drawing_tests.lua at line 339
-- wait until saveApp.wait_fake_time(3.1)App.update(0) - edit in drawing_tests.lua at line 369
-- wait until saveApp.wait_fake_time(3.1)App.update(0) - resurrect zombie in drawing_tests.lua at line 369
-- wait until saveApp.wait_fake_time(3.1)App.update(0) - edit in drawing_tests.lua at line 398
-- wait until saveApp.wait_fake_time(3.1)App.update(0) - resolve order conflict in drawing_tests.lua at line 398
- edit in drawing_tests.lua at line 403
endfunction test_move_point_on_manhattan_line()io.write('\ntest_move_point_on_manhattan_line')-- create a drawing with a manhattan lineFilename = 'foo'App.screen.init{width=Margin_left+300, height=300}Lines = load_array{'```lines', '```', ''}Line_width = 256 -- drawing coordinates 1:1 with pixelsCurrent_drawing_mode = 'manhattan'App.draw()App.run_after_mouse_press(Margin_left+5, Margin_top+Drawing_padding_top+6, 1)App.run_after_mouse_release(Margin_left+35, Margin_top+Drawing_padding_top+46, 1)local drawing = Lines[1]check_eq(#drawing.shapes, 1, 'F - test_move_point_on_manhattan_line/baseline/#shapes')check_eq(#drawing.points, 2, 'F - test_move_point_on_manhattan_line/baseline/#points')check_eq(drawing.shapes[1].mode, 'manhattan', 'F - test_move_point_on_manhattan_line/baseline/shape:1')App.draw()-- enter 'move' modeApp.run_after_keychord('C-u')check_eq(Current_drawing_mode, 'move', 'F - test_move_point_on_manhattan_line/mode:1')-- move pointApp.mouse_move(Margin_left+26, Margin_top+Drawing_padding_top+44)App.update(0.05)-- line is no longer manhattancheck_eq(drawing.shapes[1].mode, 'line', 'F - test_move_point_on_manhattan_line/baseline/shape:1') - resolve order conflict in drawing_tests.lua at line 405
- edit in drawing_tests.lua at line 456
-- wait for some timeApp.wait_fake_time(3.1)App.update(0) - resolve order conflict in drawing_tests.lua at line 456
- edit in drawing_tests.lua at line 522
-- wait until saveApp.wait_fake_time(3.1)App.update(0) - edit in drawing_tests.lua at line 574
-- wait until saveApp.wait_fake_time(3.1)App.update(0) - resolve order conflict in drawing_tests.lua at line 574
- edit in drawing_tests.lua at line 613
-- wait until saveApp.wait_fake_time(3.1)App.update(0) - resolve order conflict in drawing_tests.lua at line 613
- edit in drawing.lua at line 249
Drawing.relax_constraints(drawing, drawing.pending.target_point_index) - edit in drawing.lua at line 257
Drawing.relax_constraints(drawing, drawing.pending.target_point_index) - edit in drawing.lua at line 261[25.300]→[25.1041:1052](∅→∅),[25.4301]→[25.1041:1052](∅→∅),[25.1041]→[25.1041:1052](∅→∅),[25.1052]→[8.1413:1864](∅→∅)
endendfunction 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'endendend - resolve order conflict in drawing.lua at line 264
- edit in drawing.lua at line 299
drawing.pending.p2 = Drawing.insert_point(drawing.points, mx,my) - edit in drawing.lua at line 307
drawing.pending.p2 = Drawing.insert_point(drawing.points, mx, p1.y) - edit in drawing.lua at line 309
drawing.pending.p2 = Drawing.insert_point(drawing.points, p1.x, my) - edit in drawing.lua at line 386[4.4500]→[25.1398:1589](∅→∅),[25.1398]→[25.1398:1589](∅→∅),[25.5858]→[15.15:1398](∅→∅),[25.5858]→[15.15:1398](∅→∅)
drawing.pending.p1 = drawing.pending.centerenddrawing.pending.mode = 'manhattan'elseif chord == 'C-m' and not App.mouse_down(1) thenCurrent_drawing_mode = 'manhattan'elseif App.mouse_down(1) and chord == 'l' thenCurrent_drawing_mode = 'line'local _,drawing = Drawing.current_drawing()if drawing.pending.mode == 'freehand' thendrawing.pending.p1 = Drawing.insert_point(drawing.points, drawing.pending.points[1].x, drawing.pending.points[1].y)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) thenCurrent_drawing_mode = 'line'elseif App.mouse_down(1) and chord == 'm' thenCurrent_drawing_mode = 'manhattan'local drawing = Drawing.select_drawing_at_mouse()if drawing.pending.mode == 'freehand' thendrawing.pending.p1 = Drawing.insert_point(drawing.points, drawing.pending.points[1].x, drawing.pending.points[1].y)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' then - resurrect zombie in drawing.lua at line 386
drawing.pending.p1 = drawing.pending.centerenddrawing.pending.mode = 'manhattan'elseif chord == 'C-m' and not App.mouse_down(1) thenCurrent_drawing_mode = 'manhattan' - resolve order conflict in drawing.lua at line 386
- edit in drawing.lua at line 391
elseif drawing.pending.mode == 'rectangle' or drawing.pending.mode == 'square' then - edit in drawing.lua at line 403
elseif drawing.pending.mode == 'polygon' or drawing.pending.mode == 'square' then-- reuse existing (1-2) vertices - resolve order conflict in drawing.lua at line 403
- edit in drawing.lua at line 406
elseif 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} - edit in drawing.lua at line 486
local drawing_index,drawing,i,p = Drawing.select_point_at_mouse() - edit in drawing.lua at line 492
drawing.pending = {mode=Current_drawing_mode, target_point=p, target_point_index=i} - edit in app.lua at line 168
App.time = 1function App.getTime()return App.timeendfunction App.wait_fake_time(t)App.time = App.time + tend - resolve order conflict in app.lua at line 168
- edit in app.lua at line 346
App.time = nil - resolve order conflict in app.lua at line 346
- edit in app.lua at line 350
App.run_after_mouse_click = nilApp.run_after_mouse_press = nilApp.run_after_mouse_release = nil - edit in app.lua at line 366
App.getTime = love.timer.getTime - edit in README.md at line 79
* `alt+right`/`alt+left` to jump to the next/previous word, respectively - resolve order conflict in README.md at line 79
- edit in README.md at line 112
* No clipping yet for drawings. In particular, circles/squares/rectangles andpoint labels can overflow a drawing. - resolve order conflict in README.md at line 112
- edit in README.md at line 129
* https://github.com/akkartik/lines-polygon-experiment -- an experiment thatuses separate shortcuts for regular polygons. `ctrl+3` for triangles,`ctrl+4` for squares, etc. - resolve order conflict in README.md at line 129
- edit in Manual_tests.md at line 11
byte offsets with the suffix `_offset`, and character positions as `_pos`.For example, `string.sub` should never use a `_pos` to substring, only an`_offset`.