28 lines
919 B
Plaintext
28 lines
919 B
Plaintext
B = function(preserve_screen_top_of_cursor_node)
|
|
print('B')
|
|
-- recompute various aspects based on the current viewport settings
|
|
love.graphics.setFont(love.graphics.newFont(scale(20))) -- editor objects implicitly depend on current font so update it
|
|
for _,obj in ipairs(Surface) do
|
|
if obj.type == 'line' then
|
|
obj.zdata = {}
|
|
print('A', #obj.data)
|
|
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, preserve_screen_top_of_cursor_node)
|
|
else
|
|
obj.text = love.graphics.newText(love.graphics.getFont(), obj.data)
|
|
end
|
|
end
|
|
end
|
|
end |