about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-12-12 23:35:24 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-12-12 23:36:02 -0800
commite1f99e7fad9ab6d07c478edce2ba740a83f676cc (patch)
tree9825c464813fcbf727a312a1173b462cea1f339b
parent7d1946593146a6b1cccf8195f5ed1ea94617833f (diff)
parentd63178244bfff87f0b6e17f0a67305fe684193ae (diff)
downloadview.love-e1f99e7fad9ab6d07c478edce2ba740a83f676cc.tar.gz
Merge lines.love
-rw-r--r--drawing_tests.lua36
1 files changed, 18 insertions, 18 deletions
diff --git a/drawing_tests.lua b/drawing_tests.lua
index 80a91f1..feadd85 100644
--- a/drawing_tests.lua
+++ b/drawing_tests.lua
@@ -185,7 +185,7 @@ function test_draw_circle_mid_stroke()
   -- draw a circle
   App.mouse_move(Editor_state.left+4, Editor_state.top+Drawing_padding_top+4)  -- hover on drawing
   edit.run_after_mouse_press(Editor_state, Editor_state.left+35, Editor_state.top+Drawing_padding_top+36, 1)
-  edit.run_after_keychord(Editor_state, 'o')
+  edit.run_after_textinput(Editor_state, 'o')
   edit.run_after_mouse_release(Editor_state, Editor_state.left+35+30, Editor_state.top+Drawing_padding_top+36, 1)
   local drawing = Editor_state.lines[1]
   check_eq(#drawing.shapes, 1, 'F - test_draw_circle_mid_stroke/#shapes')
@@ -214,7 +214,7 @@ function test_draw_arc()
   -- draw an arc
   edit.run_after_mouse_press(Editor_state, Editor_state.left+35, Editor_state.top+Drawing_padding_top+36, 1)
   App.mouse_move(Editor_state.left+35+30, Editor_state.top+Drawing_padding_top+36)
-  edit.run_after_keychord(Editor_state, 'a')  -- arc mode
+  edit.run_after_textinput(Editor_state, 'a')  -- arc mode
   edit.run_after_mouse_release(Editor_state, Editor_state.left+35+50, Editor_state.top+Drawing_padding_top+36+50, 1)  -- 45°
   local drawing = Editor_state.lines[1]
   check_eq(#drawing.shapes, 1, 'F - test_draw_arc/#shapes')
@@ -245,10 +245,10 @@ function test_draw_polygon()
   check_eq(#Editor_state.lines[1].shapes, 0, 'F - test_draw_polygon/baseline/#shapes')
   -- first point
   edit.run_after_mouse_press(Editor_state, Editor_state.left+5, Editor_state.top+Drawing_padding_top+6, 1)
-  edit.run_after_keychord(Editor_state, 'g')  -- polygon mode
+  edit.run_after_textinput(Editor_state, 'g')  -- polygon mode
   -- second point
   App.mouse_move(Editor_state.left+65, Editor_state.top+Drawing_padding_top+36)
-  edit.run_after_keychord(Editor_state, 'p')  -- add point
+  edit.run_after_textinput(Editor_state, 'p')  -- add point
   -- final point
   edit.run_after_mouse_release(Editor_state, Editor_state.left+35, Editor_state.top+Drawing_padding_top+26, 1)
   local drawing = Editor_state.lines[1]
@@ -284,13 +284,13 @@ function test_draw_rectangle()
   check_eq(#Editor_state.lines[1].shapes, 0, 'F - test_draw_rectangle/baseline/#shapes')
   -- first point
   edit.run_after_mouse_press(Editor_state, Editor_state.left+35, Editor_state.top+Drawing_padding_top+36, 1)
-  edit.run_after_keychord(Editor_state, 'r')  -- rectangle mode
+  edit.run_after_textinput(Editor_state, 'r')  -- rectangle mode
   -- second point/first edge
   App.mouse_move(Editor_state.left+42, Editor_state.top+Drawing_padding_top+45)
-  edit.run_after_keychord(Editor_state, 'p')
+  edit.run_after_textinput(Editor_state, 'p')
   -- override second point/first edge
   App.mouse_move(Editor_state.left+75, Editor_state.top+Drawing_padding_top+76)
-  edit.run_after_keychord(Editor_state, 'p')
+  edit.run_after_textinput(Editor_state, 'p')
   -- release (decides 'thickness' of rectangle perpendicular to first edge)
   edit.run_after_mouse_release(Editor_state, Editor_state.left+15, Editor_state.top+Drawing_padding_top+26, 1)
   local drawing = Editor_state.lines[1]
@@ -329,13 +329,13 @@ function test_draw_rectangle_intermediate()
   check_eq(#Editor_state.lines[1].shapes, 0, 'F - test_draw_rectangle_intermediate/baseline/#shapes')
   -- first point
   edit.run_after_mouse_press(Editor_state, Editor_state.left+35, Editor_state.top+Drawing_padding_top+36, 1)
-  edit.run_after_keychord(Editor_state, 'r')  -- rectangle mode
+  edit.run_after_textinput(Editor_state, 'r')  -- rectangle mode
   -- second point/first edge
   App.mouse_move(Editor_state.left+42, Editor_state.top+Drawing_padding_top+45)
-  edit.run_after_keychord(Editor_state, 'p')
+  edit.run_after_textinput(Editor_state, 'p')
   -- override second point/first edge
   App.mouse_move(Editor_state.left+75, Editor_state.top+Drawing_padding_top+76)
-  edit.run_after_keychord(Editor_state, 'p')
+  edit.run_after_textinput(Editor_state, 'p')
   local drawing = Editor_state.lines[1]
   check_eq(#drawing.points, 3, 'F - test_draw_rectangle_intermediate/#points')  -- currently includes every point added
   local pending = drawing.pending
@@ -366,13 +366,13 @@ function test_draw_square()
   check_eq(#Editor_state.lines[1].shapes, 0, 'F - test_draw_square/baseline/#shapes')
   -- first point
   edit.run_after_mouse_press(Editor_state, Editor_state.left+35, Editor_state.top+Drawing_padding_top+36, 1)
-  edit.run_after_keychord(Editor_state, 's')  -- square mode
+  edit.run_after_textinput(Editor_state, 's')  -- square mode
   -- second point/first edge
   App.mouse_move(Editor_state.left+42, Editor_state.top+Drawing_padding_top+45)
-  edit.run_after_keychord(Editor_state, 'p')
+  edit.run_after_textinput(Editor_state, 'p')
   -- override second point/first edge
   App.mouse_move(Editor_state.left+65, Editor_state.top+Drawing_padding_top+66)
-  edit.run_after_keychord(Editor_state, 'p')
+  edit.run_after_textinput(Editor_state, 'p')
   -- release (decides which side of first edge to draw square on)
   edit.run_after_mouse_release(Editor_state, Editor_state.left+15, Editor_state.top+Drawing_padding_top+26, 1)
   local drawing = Editor_state.lines[1]
@@ -594,13 +594,13 @@ function test_delete_point_from_polygon()
   edit.draw(Editor_state)
   -- first point
   edit.run_after_mouse_press(Editor_state, Editor_state.left+5, Editor_state.top+Drawing_padding_top+6, 1)
-  edit.run_after_keychord(Editor_state, 'g')  -- polygon mode
+  edit.run_after_textinput(Editor_state, 'g')  -- polygon mode
   -- second point
   App.mouse_move(Editor_state.left+65, Editor_state.top+Drawing_padding_top+36)
-  edit.run_after_keychord(Editor_state, 'p')  -- add point
+  edit.run_after_textinput(Editor_state, 'p')  -- add point
   -- third point
   App.mouse_move(Editor_state.left+35, Editor_state.top+Drawing_padding_top+26)
-  edit.run_after_keychord(Editor_state, 'p')  -- add point
+  edit.run_after_textinput(Editor_state, 'p')  -- add point
   -- fourth point
   edit.run_after_mouse_release(Editor_state, Editor_state.left+14, Editor_state.top+Drawing_padding_top+16, 1)
   local drawing = Editor_state.lines[1]
@@ -626,10 +626,10 @@ function test_delete_point_from_polygon()
   edit.draw(Editor_state)
   -- first point
   edit.run_after_mouse_press(Editor_state, Editor_state.left+5, Editor_state.top+Drawing_padding_top+6, 1)
-  edit.run_after_keychord(Editor_state, 'g')  -- polygon mode
+  edit.run_after_textinput(Editor_state, 'g')  -- polygon mode
   -- second point
   App.mouse_move(Editor_state.left+65, Editor_state.top+Drawing_padding_top+36)
-  edit.run_after_keychord(Editor_state, 'p')  -- add point
+  edit.run_after_textinput(Editor_state, 'p')  -- add point
   -- third point
   edit.run_after_mouse_release(Editor_state, Editor_state.left+14, Editor_state.top+Drawing_padding_top+16, 1)
   local drawing = Editor_state.lines[1]