about summary refs log tree commit diff stats
path: root/drawing.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-05-21 08:40:15 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-21 08:41:54 -0700
commit5d8e7a3cc6bde06cd8ef79bae66538b22d34b957 (patch)
tree90d49901aed3507f4984748f47b9cb11b5d1419c /drawing.lua
parent10c961855aa432e4a1341fffbc7ee513f5d9e439 (diff)
downloadlines.love-5d8e7a3cc6bde06cd8ef79bae66538b22d34b957.tar.gz
several bugfixes
All introduced when I built rectangles and squares in commit e27165cb.
Diffstat (limited to 'drawing.lua')
-rw-r--r--drawing.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/drawing.lua b/drawing.lua
index cb5ec6f..b7a0d3b 100644
--- a/drawing.lua
+++ b/drawing.lua
@@ -171,6 +171,8 @@ function Drawing.draw_pending_shape(left,top, drawing)
     shape.end_angle = geom.angle_with_hint(center.x,center.y, mx,my, shape.end_angle)
     local cx,cy = Drawing.pixels(center.x)+left, Drawing.pixels(center.y)+top
     love.graphics.arc('line', 'open', cx,cy, Drawing.pixels(shape.radius), shape.start_angle, shape.end_angle, 360)
+  elseif shape.mode == 'move' then
+    -- nothing pending; changes are immediately committed
   else
     print(shape.mode)
     assert(false)
@@ -195,6 +197,8 @@ function Drawing.mouse_pressed(drawing, x,y, button)
   elseif Current_drawing_mode == 'circle' then
     local j = Drawing.insert_point(drawing.points, Drawing.coord(x-16), Drawing.coord(y-drawing.y))
     drawing.pending = {mode=Current_drawing_mode, center=j}
+  elseif Current_drawing_mode == 'move' then
+    -- all the action is in mouse_released
   else
     print(Current_drawing_mode)
     assert(false)
@@ -225,8 +229,7 @@ function Drawing.update()
       drawing.pending.target_point.y = my
     end
   else
-    print(Current_drawing_mode)
-    assert(false)
+    -- do nothing
   end
 end