baby steps

This commit is contained in:
Kartik K. Agaram 2023-04-17 21:17:16 -07:00
parent d6dafd812a
commit 30f61face5
5 changed files with 6 additions and 41 deletions

View File

@ -1,19 +0,0 @@
Page = {
type='text', x=0, y=0,
name='editor',
doc='prose goes here, on the left half of the window',
margin=Margin_left,
data={
"Lorem Ipsum",
'1',
'2',
'3',
'mno',
'Acb',
'g',
'hij',
'klm',
'nop',
},
width=400,
}

View File

@ -1,12 +1,2 @@
Surface = {
-- 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}},
}

8
0028-A
View File

@ -1,8 +1,10 @@
A = function(preserve_screen_top_of_cursor_node)
-- translate Page to Surface
-- translate Nodes to Surface
while #Surface > 0 do table.remove(Surface) end
compute_layout(Page, Page.x,Page.y, Surface, preserve_screen_top_of_cursor_node)
for _, node in ipairs(Nodes) do
compute_layout(node, node.x,node.y, Surface, preserve_screen_top_of_cursor_node)
end
-- continue the pipeline
B(preserve_screen_top_of_cursor_node)
-- TODO: ugly that we're manipulating editor objects twice
end
end

View File

@ -1,9 +0,0 @@
Page2 = {
x=500, y=300,
-- page
type='text',
data={
"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."
},
width=400, bg={r=0,g=0.8,b=0}
}

1
0031-Nodes Normal file
View File

@ -0,0 +1 @@
Nodes = {}