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6T6TSQLCMTS4OENCCGWYEBZ52RK42PV6NMMNZZPKUAC F5BF4M6KKVFYOO65BMF3TNRTYIOHNVVMPLEQSSX6UCNOOEQMKIIAC LTINBYJOAVVH5E3RUBFYZG7NPZKH2ZBCSL2SVX2THO6XP3GXSB2AC 5HBC66CSFQ257TO3DJYBUNKE5RKR47CUJNMYP6Y4F7T6W7LNRV4AC CDW426K3SG5CZ6BFCDQMQEL2NZKRQPF5DIFNS25CHV63R3BWBXRAC FLP5PSEUNSNVC6BFZA7FITEPE53FWY67X7JKDXC4YJYCVEN2BCJQC LIWKX2BUGJ2S3JBILVBQ23FBBGKGOIWPILVZSFESSDSHAPYA5POQC TBPJ5WSRM5IKQH7FTAVYTWWUBWW7G2CLT5M6FN7CMPLD6Y77YIWQC ZQMQVMFWZIGWBRCB455IKHPTAOUYPLYCSC44NBPPET557RGVRX3AC TK73HJVXQCBEEN4ATMLSSG4DI2XZJAQEJICJ472E3YAW55EFAT5AC X7HYGAL2QVKG7M5EMZ2VSH37UYWGE3EPUXYQBJOVL6IGJFZ2I5AAC 4WW67KAXORLJFOJVWV3CP4VNHTEIJY5WQMSDMXMFKRWSI5EEHTRAC ZANGJNNX6EITFBOF6NWCF2EM5BDQDEIOD4UPWMF5I6SKAURRTIHAC KV64IWA3DKR4FL6E4BIG5SFCRQJ3DZFEJOUELCD5TC7DDVJQ6SWAC FBDRJ53NJ5BWDQGU2GWZ6NEYHKCCRD7RODMIG7QQZBRFUB4HR7OAC COQFPMPXILQYUQNRTLASNXLCWUNQTQKAA7UMWUOOTED2MVYXUCZAC VHT5NALKBXY6CZ2AJPLIJ33OSP5X2TF6GTDMIYXVKNIXPZXPAMAAC Page2 = {x=500, y=300,-- pagetype='text',data={},width=400, bg={r=0,g=0.8,b=0}}"Call me Ishmael. Some years ago--never mind how long precisely--having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation. Whenever I find myself growing grim about the mouth; whenever it is a damp, drizzly November in my soul; whenever I find myself involuntarily pausing before coffin warehouses, and bringing up the rear of every funeral I meet; and especially whenever my hypos get such an upper hand of me, that it requires a strong moral principle to prevent me from deliberately stepping into the street, and methodically knocking people's hats off--then, I account it high time to get to sea as soon as I can. This is my substitute for pistol and ball. With a philosophical flourish Cato throws himself upon his sword; I quietly take to the ship. There is nothing surprising in this. If they but knew it, almost all men in their degree, some time or other, cherish very nearly the same feelings towards the ocean with me.",'1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60',
love.graphics.setFont(love.graphics.newFont(scale(20))) -- editor objects implicitly depend on current font-- continue the pipeline-- TODO: ugly that we're manipulating editor objects twiceendB(skip_updating_screen_top_for)-- translate Page and Page2 to SurfaceSurface = {}local red = falsefor x=-1000,2000,300 dofor y=-10000,10000,200 doadd_thick_line({type='line', data={x,y, x+200,y+200, x,y+400}, r=red and 1 or 0,g=red and 0 or 0.5,b=0}, 10)red = not redendendcompute_layout(Page, Page.x,Page.y, Surface, skip_updating_screen_top_for)compute_layout(Page2, Page2.x,Page2.y, Surface, skip_updating_screen_top_for)A = function(skip_updating_screen_top_for)
-- a table on the right{ type='rows', name='searches', margin=50, data={{ type='text', data={''},},{ type='cols', data={{ type='text', data={'search:'},},{ type='text', name='search', bg={r=0.8,g=0.8,b=0.8}, data={''}, width=90,},}},{ type='text', data={'table:'},},{ type='cols', bg={r=0.8,g=0.8,b=0.8}, data={{ type='rows', width=90, data={{type='text', data={'abc'},},{type='text', data={'abc'},},}},{ type='rows', width=90, data={{type='text', data={'def'},},{type='text', data={'def'},},}},}},}},},width=400, bg={r=1,g=1,b=0}},"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",'1','2','3','mno','Acb','g','hij','klm','nop',},}
* Position a node with some of its area above (outside) viewport. Position cursor at topmost row on screen. Hit up arrow. Surface pans.
* Position a node with some of its area above (outside) viewport. Position cursor at topmost row on screen. Hit up arrow. Surface pans. Cursor doesn't hide behind menu bar.
node.editor.screen_top1, node.editor.top = schema1_of_y(node.editor, scale(Viewport.y-node.y))
node.editor.screen_top1, node.editor.top = schema1_of_y(node.editor, scale(Viewport.y-node.y)) -- scale y because editor's font is scalednode.editor.top = node.editor.top + Menu_bar_height
Text.redraw_all(node.editor)
-- test data{type='line', data={0,-1000, 0,1000}},{type='line', data={-10000,0, 10000,0}},{type='text', data={'0'}, x=-20,y=-30},{type='rectangle', x=50,y=50, w=20,h=80, r=1,g=0,b=0},{type='text', data={'abc', 'def'}, x=150, y=50, w=50,h=50, fg={r=0,g=0.4, b=0.9}},{type='circle', x=300,y=200, radius=40, r=1,g=0,b=1},{type='arc', x=0,y=0, radius=50, angle1=0, angle2=math.pi*2/3},{type='ellipse', x=100,y=100, radiusx=10, radiusy=50},{type='bezier', data={25,25, 25,125, 75,25, 125,25}},}
endlove.graphics.setColor(0,0,0)love.graphics.line(50, 0, 50, App.screen.height)for i=0,100 dolove.graphics.print(tostring(i), 30, i*100)endlocal vy0 = vy(0)love.graphics.line(100, vy0, 100, App.screen.height)for i=0,100 dolove.graphics.print(tostring(i), 80, vy0+i*100)endlove.graphics.line(vx(0), vy(0), vx(0), vy(1000000))love.graphics.line(vx(0), vy(0), vx(1000000), vy(0))for i=0,100 dolove.graphics.print(tostring(i), vx(0)-20, vy(i*100))
elseif chord == 'C-g' then-- special Expose-like 'global zoom' modeif Zoomed_out == nil thenzoom_out()elseundo_zoom_out()endelseif chord == 'C-q' thenlive.send_to_app('QUIT')elseif Manifest_navigator.show thenkeychord_press_on_manifest_navigator(chord, key)elseif chord == 'C-n' thennew_definition()A()elseif chord == 'C-l' thenManifest_navigator.show = trueManifest_navigator.for_delete = falseinitialize_manifest_navigator()elseif chord == 'C-d' thenManifest_navigator.show = trueManifest_navigator.for_delete = trueinitialize_manifest_navigator()
local definition_name = live.get_definition_name_from_buffer(live.definition_to_string(Cursor_node.editor))maybe_update_key_in_definitions(old_definition_name, definition_name, Cursor_node)
A(--[[skip updating screen_top for]] Cursor_node)returnA()
B = function(skip_updating_screen_top_for)-- recompute various aspects based on the current viewport settingsfor _,obj in ipairs(Surface) doif obj.type == 'line' thenobj.zdata = {}for i=1,#obj.data,2 dotable.insert(obj.zdata, vx(obj.data[i]))table.insert(obj.zdata, vy(obj.data[i+1]))endelseif obj.type == 'bezier' thenzdata = {}for i=1,#obj.data,2 dotable.insert(zdata, vx(obj.data[i]))table.insert(zdata, vy(obj.data[i+1]))endobj.zdata = love.math.newBezierCurve(zdata):render()elseif obj.type == 'text' thenif obj.w thenupdate_editor_box(obj, skip_updating_screen_top_for)elseobj.text = love.graphics.newText(love.graphics.getFont(), obj.data)endendendend
return y-- return the height of a text editor node (explicit width). The result is unscaled.local y = 0node.editor.line_cache[i].fragments = nily = y + node.editor.line_height*#node.editor.line_cache[i].screen_line_starting_pos
-- HACK: modify obj.editor.left after initializationobj.editor = edit.initialize_state(Menu_bar_height + vy(obj.y), math.floor(vx(obj.x)), math.ceil(vx(obj.x+obj.w)), scaled_fontsize, scaled_lineheight)obj.editor.left = obj.editor.left + Line_number_width*App.width('m')
scale = function(d)return d*Viewport.zoomend