diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-06-14 21:08:03 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-06-14 21:08:07 -0700 |
commit | 93a9dfd364af15fb4def09c9cab287d1601ea15c (patch) | |
tree | 6329b2f57846be37bfd7a1616d1056c7466096cc /drawing.lua | |
parent | 4f9789db413fa92417a5d4ae4ec6a27c6d357550 (diff) | |
download | view.love-93a9dfd364af15fb4def09c9cab287d1601ea15c.tar.gz |
test: moving a point
I found some code in the process that seems unreachable. Some chance of a regression here..
Diffstat (limited to 'drawing.lua')
-rw-r--r-- | drawing.lua | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drawing.lua b/drawing.lua index 45d93dd..6ed50ce 100644 --- a/drawing.lua +++ b/drawing.lua @@ -260,6 +260,10 @@ function Drawing.mouse_released(x,y, button) if Current_drawing_mode == 'move' then Current_drawing_mode = Previous_drawing_mode Previous_drawing_mode = nil + if Lines.current_drawing then + Lines.current_drawing.pending = {} + Lines.current_drawing = nil + end elseif Lines.current_drawing then local drawing = Lines.current_drawing if drawing.pending then @@ -336,8 +340,6 @@ function Drawing.mouse_released(x,y, button) drawing.pending.end_angle = geom.angle_with_hint(center.x,center.y, mx,my, drawing.pending.end_angle) table.insert(drawing.shapes, drawing.pending) end - elseif drawing.pending.mode == 'move' then - -- drop it elseif drawing.pending.mode == 'name' then -- drop it else @@ -486,17 +488,6 @@ function Drawing.keychord_pressed(chord) Lines.current_drawing_index = drawing_index Lines.current_drawing = drawing end - elseif App.mouse_down(1) and chord == 'v' then - local drawing_index,drawing,_,p = Drawing.select_point_at_mouse() - if drawing then - if Previous_drawing_mode == nil then - Previous_drawing_mode = Current_drawing_mode - end - Current_drawing_mode = 'move' - drawing.pending = {mode=Current_drawing_mode, target_point=p} - Lines.current_drawing_index = drawing_index - Lines.current_drawing = drawing - end elseif chord == 'C-n' and not App.mouse_down(1) then local drawing_index,drawing,point_index,p = Drawing.select_point_at_mouse() if drawing then |