about summary refs log tree commit diff stats
path: root/drawing_tests.lua
diff options
context:
space:
mode:
Diffstat (limited to 'drawing_tests.lua')
-rw-r--r--drawing_tests.lua20
1 files changed, 10 insertions, 10 deletions
diff --git a/drawing_tests.lua b/drawing_tests.lua
index 4488fa9..5301318 100644
--- a/drawing_tests.lua
+++ b/drawing_tests.lua
@@ -34,7 +34,7 @@ function test_draw_line()
   edit.draw(Editor_state)
   check_eq(#Editor_state.lines, 2, 'F - test_draw_line/baseline/#lines')
   check_eq(Editor_state.lines[1].mode, 'drawing', 'F - test_draw_line/baseline/mode')
-  check_eq(Editor_state.lines[1].y, Editor_state.top+Drawing_padding_top, 'F - test_draw_line/baseline/y')
+  check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'F - test_draw_line/baseline/y')
   check_eq(Editor_state.lines[1].h, 128, 'F - test_draw_line/baseline/y')
   check_eq(#Editor_state.lines[1].shapes, 0, 'F - test_draw_line/baseline/#shapes')
   -- draw a line
@@ -80,7 +80,7 @@ function test_draw_horizontal_line()
   edit.draw(Editor_state)
   check_eq(#Editor_state.lines, 2, 'F - test_draw_horizontal_line/baseline/#lines')
   check_eq(Editor_state.lines[1].mode, 'drawing', 'F - test_draw_horizontal_line/baseline/mode')
-  check_eq(Editor_state.lines[1].y, Editor_state.top+Drawing_padding_top, 'F - test_draw_horizontal_line/baseline/y')
+  check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'F - test_draw_horizontal_line/baseline/y')
   check_eq(Editor_state.lines[1].h, 128, 'F - test_draw_horizontal_line/baseline/y')
   check_eq(#Editor_state.lines[1].shapes, 0, 'F - test_draw_horizontal_line/baseline/#shapes')
   -- draw a line that is more horizontal than vertical
@@ -109,7 +109,7 @@ function test_draw_circle()
   edit.draw(Editor_state)
   check_eq(#Editor_state.lines, 2, 'F - test_draw_circle/baseline/#lines')
   check_eq(Editor_state.lines[1].mode, 'drawing', 'F - test_draw_circle/baseline/mode')
-  check_eq(Editor_state.lines[1].y, Editor_state.top+Drawing_padding_top, 'F - test_draw_circle/baseline/y')
+  check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'F - test_draw_circle/baseline/y')
   check_eq(Editor_state.lines[1].h, 128, 'F - test_draw_circle/baseline/y')
   check_eq(#Editor_state.lines[1].shapes, 0, 'F - test_draw_circle/baseline/#shapes')
   -- draw a circle
@@ -139,7 +139,7 @@ function test_cancel_stroke()
   edit.draw(Editor_state)
   check_eq(#Editor_state.lines, 2, 'F - test_cancel_stroke/baseline/#lines')
   check_eq(Editor_state.lines[1].mode, 'drawing', 'F - test_cancel_stroke/baseline/mode')
-  check_eq(Editor_state.lines[1].y, Editor_state.top+Drawing_padding_top, 'F - test_cancel_stroke/baseline/y')
+  check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'F - test_cancel_stroke/baseline/y')
   check_eq(Editor_state.lines[1].h, 128, 'F - test_cancel_stroke/baseline/y')
   check_eq(#Editor_state.lines[1].shapes, 0, 'F - test_cancel_stroke/baseline/#shapes')
   -- start drawing a line
@@ -179,7 +179,7 @@ function test_draw_circle_mid_stroke()
   edit.draw(Editor_state)
   check_eq(#Editor_state.lines, 2, 'F - test_draw_circle_mid_stroke/baseline/#lines')
   check_eq(Editor_state.lines[1].mode, 'drawing', 'F - test_draw_circle_mid_stroke/baseline/mode')
-  check_eq(Editor_state.lines[1].y, Editor_state.top+Drawing_padding_top, 'F - test_draw_circle_mid_stroke/baseline/y')
+  check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'F - test_draw_circle_mid_stroke/baseline/y')
   check_eq(Editor_state.lines[1].h, 128, 'F - test_draw_circle_mid_stroke/baseline/y')
   check_eq(#Editor_state.lines[1].shapes, 0, 'F - test_draw_circle_mid_stroke/baseline/#shapes')
   -- draw a circle
@@ -208,7 +208,7 @@ function test_draw_arc()
   edit.draw(Editor_state)
   check_eq(#Editor_state.lines, 2, 'F - test_draw_arc/baseline/#lines')
   check_eq(Editor_state.lines[1].mode, 'drawing', 'F - test_draw_arc/baseline/mode')
-  check_eq(Editor_state.lines[1].y, Editor_state.top+Drawing_padding_top, 'F - test_draw_arc/baseline/y')
+  check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'F - test_draw_arc/baseline/y')
   check_eq(Editor_state.lines[1].h, 128, 'F - test_draw_arc/baseline/y')
   check_eq(#Editor_state.lines[1].shapes, 0, 'F - test_draw_arc/baseline/#shapes')
   -- draw an arc
@@ -240,7 +240,7 @@ function test_draw_polygon()
   check_eq(Editor_state.current_drawing_mode, 'line', 'F - test_draw_polygon/baseline/drawing_mode')
   check_eq(#Editor_state.lines, 2, 'F - test_draw_polygon/baseline/#lines')
   check_eq(Editor_state.lines[1].mode, 'drawing', 'F - test_draw_polygon/baseline/mode')
-  check_eq(Editor_state.lines[1].y, Editor_state.top+Drawing_padding_top, 'F - test_draw_polygon/baseline/y')
+  check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'F - test_draw_polygon/baseline/y')
   check_eq(Editor_state.lines[1].h, 128, 'F - test_draw_polygon/baseline/y')
   check_eq(#Editor_state.lines[1].shapes, 0, 'F - test_draw_polygon/baseline/#shapes')
   -- first point
@@ -279,7 +279,7 @@ function test_draw_rectangle()
   check_eq(Editor_state.current_drawing_mode, 'line', 'F - test_draw_rectangle/baseline/drawing_mode')
   check_eq(#Editor_state.lines, 2, 'F - test_draw_rectangle/baseline/#lines')
   check_eq(Editor_state.lines[1].mode, 'drawing', 'F - test_draw_rectangle/baseline/mode')
-  check_eq(Editor_state.lines[1].y, Editor_state.top+Drawing_padding_top, 'F - test_draw_rectangle/baseline/y')
+  check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'F - test_draw_rectangle/baseline/y')
   check_eq(Editor_state.lines[1].h, 128, 'F - test_draw_rectangle/baseline/y')
   check_eq(#Editor_state.lines[1].shapes, 0, 'F - test_draw_rectangle/baseline/#shapes')
   -- first point
@@ -324,7 +324,7 @@ function test_draw_rectangle_intermediate()
   check_eq(Editor_state.current_drawing_mode, 'line', 'F - test_draw_rectangle_intermediate/baseline/drawing_mode')
   check_eq(#Editor_state.lines, 2, 'F - test_draw_rectangle_intermediate/baseline/#lines')
   check_eq(Editor_state.lines[1].mode, 'drawing', 'F - test_draw_rectangle_intermediate/baseline/mode')
-  check_eq(Editor_state.lines[1].y, Editor_state.top+Drawing_padding_top, 'F - test_draw_rectangle_intermediate/baseline/y')
+  check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'F - test_draw_rectangle_intermediate/baseline/y')
   check_eq(Editor_state.lines[1].h, 128, 'F - test_draw_rectangle_intermediate/baseline/y')
   check_eq(#Editor_state.lines[1].shapes, 0, 'F - test_draw_rectangle_intermediate/baseline/#shapes')
   -- first point
@@ -361,7 +361,7 @@ function test_draw_square()
   check_eq(Editor_state.current_drawing_mode, 'line', 'F - test_draw_square/baseline/drawing_mode')
   check_eq(#Editor_state.lines, 2, 'F - test_draw_square/baseline/#lines')
   check_eq(Editor_state.lines[1].mode, 'drawing', 'F - test_draw_square/baseline/mode')
-  check_eq(Editor_state.lines[1].y, Editor_state.top+Drawing_padding_top, 'F - test_draw_square/baseline/y')
+  check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'F - test_draw_square/baseline/y')
   check_eq(Editor_state.lines[1].h, 128, 'F - test_draw_square/baseline/y')
   check_eq(#Editor_state.lines[1].shapes, 0, 'F - test_draw_square/baseline/#shapes')
   -- first point