about summary refs log tree commit diff stats
path: root/main.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-06-02 15:51:44 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-06-02 15:51:44 -0700
commitb4e76eac4e4773d2f4a46bd5ced7c22d8ffc8b15 (patch)
treeed173c38f17b9c32f7df018ab063120bf4916618 /main.lua
parent670886240f78314b9925e94e1814a8ade5fbaf3e (diff)
downloadview.love-b4e76eac4e4773d2f4a46bd5ced7c22d8ffc8b15.tar.gz
bugfix: undo drawing creation
Also clean up drawing state to make sure we don't get into hard-to-debug
situations.
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/main.lua b/main.lua
index 9372207..38fafa2 100644
--- a/main.lua
+++ b/main.lua
@@ -142,6 +142,7 @@ function App.draw()
         button('draw', {x=4,y=y+4, w=12,h=12, color={1,1,0},
           icon = icon.insert_drawing,
           onpress1 = function()
+                       Drawing.before = snapshot_everything()
                        table.insert(Lines, line_index, {mode='drawing', y=y, h=256/2, points={}, shapes={}, pending={}})
                        if Cursor1.line >= line_index then
                          Cursor1.line = Cursor1.line+1