about summary refs log tree commit diff stats
path: root/source_undo.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-04-02 09:31:56 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-04-02 09:31:56 -0700
commit24a48e665ff381b0c134fe7c834b5476686b441e (patch)
treefd196e4a6bc430a46e67e4c3573842bd2b284834 /source_undo.lua
parent1330e4b9168e07b629a47dec436dec2484686db7 (diff)
parent3547c18db6b9d508fb5c2399c124e33f4cc8c488 (diff)
downloadview.love-24a48e665ff381b0c134fe7c834b5476686b441e.tar.gz
Merge text.love
Diffstat (limited to 'source_undo.lua')
-rw-r--r--source_undo.lua9
1 files changed, 2 insertions, 7 deletions
diff --git a/source_undo.lua b/source_undo.lua
index 6023324..d3d5f0f 100644
--- a/source_undo.lua
+++ b/source_undo.lua
@@ -61,14 +61,9 @@ function snapshot(State, s,e)
   for i=s,e do
     local line = State.lines[i]
     if line.mode == 'text' then
-      table.insert(event.lines, {mode='text', data=line.data, dataB=line.dataB})
+      table.insert(event.lines, {mode='text', data=line.data})  -- I've forgotten: should we deepcopy(line.data)?
     elseif line.mode == 'drawing' then
-      local points=deepcopy(line.points)
---?       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={}})
+      table.insert(event.lines, {mode='drawing', h=line.h, points=deepcopy(line.points), shapes=deepcopy(line.shapes), pending={}})
     else
       print(line.mode)
       assert(false)