This is a big change, and I'd have to first modify lines.love to use the coordinate transforms. And that fork doesn't really need a principled coordinate system.
TK73HJVXQCBEEN4ATMLSSG4DI2XZJAQEJICJ472E3YAW55EFAT5AC
AYUZF67YZY2GQBYJJLHU6LI7KJUTBRPYY46WOD4MBVE3DIGSLM2QC
LHKEZDWPB5KDA5NYEBT4XCAP3CEBRXKIAT7FX4NFKOLAQL7BU7XAC
R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC
K6ZDYZKXSLTLCCHWYK6K6WOCNXBZOXEDKDVNNJVCZUFOLLSUO5UAC
VHT5NALKBXY6CZ2AJPLIJ33OSP5X2TF6GTDMIYXVKNIXPZXPAMAAC
ZANGJNNX6EITFBOF6NWCF2EM5BDQDEIOD4UPWMF5I6SKAURRTIHAC
QJAYOFWY7V4BWVLJMEDCCBC2HX4BDAZI6PQVLWCLYRHWGMOBFTVAC
AUZQ7ULP65IGCJYIT3U6R42HEJT35R33TQHA7XNK242KWCV6IKMAC
P36KIMZCWGBG6CZQE3W5SVTCJMYZOVEZ3U3FAF46SO5ZMMM42PHQC
PPVABNGQTQMPYILHDNSNXBI5IOCBSIYO45NIHUR4LYPABQZE6PAQC
JIBCE66ZTWM5WEHEHNKKTRWBJQSQWBDDWPMOJIJR5Q676OSHYCNAC
ZQMQVMFWZIGWBRCB455IKHPTAOUYPLYCSC44NBPPET557RGVRX3AC
X7HYGAL2QVKG7M5EMZ2VSH37UYWGE3EPUXYQBJOVL6IGJFZ2I5AAC
KV64IWA3DKR4FL6E4BIG5SFCRQJ3DZFEJOUELCD5TC7DDVJQ6SWAC
FBDRJ53NJ5BWDQGU2GWZ6NEYHKCCRD7RODMIG7QQZBRFUB4HR7OAC
love.graphics.setFont(love.graphics.newFont(scale(20))) -- editor objects implicitly depend on current font
-- translate Page to Surface
compute_layout(Page, Page.x,Page.y, Surface)
-- continue the pipeline
B()
-- TODO: ugly that we're manipulating editor objects twice
local red = false
for x=-1000,2000,300 do
for y=-10000,10000,200 do
add_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 red
end
end
love.graphics.rectangle(obj.drawmode or 'fill', vx(obj.x),vy(obj.y), scale(obj.w),scale(obj.h), scale(obj.rx or 0),scale(obj.ry or obj.rx or 0))
love.graphics.rectangle(obj.drawmode or 'fill', obj.x,obj.y, obj.w,obj.h, obj.rx or 0,obj.ry or obj.rx or 0)
love.graphics.arc(obj.drawmode or 'line', obj.arctype or 'open', vx(obj.x), vy(obj.y), scale(obj.radius), obj.angle1, obj.angle2, obj.segments)
love.graphics.arc(obj.drawmode or 'line', obj.arctype or 'open', obj.x, obj.y, obj.radius, obj.angle1, obj.angle2, obj.segments)
print('B')
-- recompute various aspects based on the current viewport settings
for _,obj in ipairs(Surface) do
if obj.type == 'line' then
obj.zdata = {}
for i=1,#obj.data,2 do
table.insert(obj.zdata, vx(obj.data[i]))
table.insert(obj.zdata, vy(obj.data[i+1]))
end
elseif obj.type == 'bezier' then
zdata = {}
for i=1,#obj.data,2 do
table.insert(zdata, vx(obj.data[i]))
table.insert(zdata, vy(obj.data[i+1]))
end
obj.zdata = love.math.newBezierCurve(zdata):render()
elseif obj.type == 'text' then
if obj.w then
update_editor_box(obj)
else
obj.text = love.graphics.newText(love.graphics.getFont(), obj.data)
end
end
end
local scaled_fontsize = scale(20)
local scaled_lineheight = math.floor(scaled_fontsize*1.3)
obj.editor = edit.initialize_state(vy(obj.y), math.floor(vx(obj.x)), math.ceil(vx(obj.x+obj.w)), scaled_fontsize, scaled_lineheight)
obj.editor = edit.initialize_state(obj.y, obj.x, obj.x+obj.w, 20, math.floor(20*1.3))