minor cleanup and a todo for later
This commit is contained in:
parent
86517606a1
commit
af239935ce
|
@ -61,14 +61,9 @@ function snapshot(State, s,e)
|
||||||
for i=s,e do
|
for i=s,e do
|
||||||
local line = State.lines[i]
|
local line = State.lines[i]
|
||||||
if line.mode == 'text' then
|
if line.mode == 'text' then
|
||||||
table.insert(event.lines, {mode='text', data=line.data})
|
table.insert(event.lines, {mode='text', data=line.data}) -- I've forgotten: should we deepcopy(line.data)?
|
||||||
elseif line.mode == 'drawing' then
|
elseif line.mode == 'drawing' then
|
||||||
local points=deepcopy(line.points)
|
table.insert(event.lines, {mode='drawing', h=line.h, points=deepcopy(line.points), shapes=deepcopy(line.shapes), pending={}})
|
||||||
--? print('copying', line.points, 'with', #line.points, 'points into', points)
|
|
||||||
local shapes=deepcopy(line.shapes)
|
|
||||||
--? print('copying', line.shapes, 'with', #line.shapes, 'shapes into', shapes)
|
|
||||||
table.insert(event.lines, {mode='drawing', h=line.h, points=points, shapes=shapes, pending={}})
|
|
||||||
--? table.insert(event.lines, {mode='drawing', h=line.h, points=deepcopy(line.points), shapes=deepcopy(line.shapes), pending={}})
|
|
||||||
else
|
else
|
||||||
print(line.mode)
|
print(line.mode)
|
||||||
assert(false)
|
assert(false)
|
||||||
|
|
9
undo.lua
9
undo.lua
|
@ -61,14 +61,9 @@ function snapshot(State, s,e)
|
||||||
for i=s,e do
|
for i=s,e do
|
||||||
local line = State.lines[i]
|
local line = State.lines[i]
|
||||||
if line.mode == 'text' then
|
if line.mode == 'text' then
|
||||||
table.insert(event.lines, {mode='text', data=line.data})
|
table.insert(event.lines, {mode='text', data=line.data}) -- I've forgotten: should we deepcopy(line.data)?
|
||||||
elseif line.mode == 'drawing' then
|
elseif line.mode == 'drawing' then
|
||||||
local points=deepcopy(line.points)
|
table.insert(event.lines, {mode='drawing', h=line.h, points=deepcopy(line.points), shapes=deepcopy(line.shapes), pending={}})
|
||||||
--? print('copying', line.points, 'with', #line.points, 'points into', points)
|
|
||||||
local shapes=deepcopy(line.shapes)
|
|
||||||
--? print('copying', line.shapes, 'with', #line.shapes, 'shapes into', shapes)
|
|
||||||
table.insert(event.lines, {mode='drawing', h=line.h, points=points, shapes=shapes, pending={}})
|
|
||||||
--? table.insert(event.lines, {mode='drawing', h=line.h, points=deepcopy(line.points), shapes=deepcopy(line.shapes), pending={}})
|
|
||||||
else
|
else
|
||||||
print(line.mode)
|
print(line.mode)
|
||||||
assert(false)
|
assert(false)
|
||||||
|
|
Loading…
Reference in New Issue