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ZI4KNNIMNLPRFQ36RAGPWNE2O5AMB42H3CSTI6QM6QC
KAUD3YIKPOXHIUZVR3VCIQHQGBPWTBHXEXC3VQIPAN2BAV6SEMIQC
7DYUAOI6WHAP75T2KEGN6CPSASO7B6L6BDE6FQ5ELND7T6X3WO4AC
4AXV2HG4NMAHAWGWD35V5PXULNORCBEKY65UQT37XNYXCSB7TWEAC
2JLVAYHBQGIYFYLPYP5MC7V3DGTSUKLKTFSAIDG4XZFWVDU33SNQC
3OTESDW65UJ2W5RIXA6FNKRSD7TBCZTCCCEAYOQMEVGYZ6RCU34QC
BCRJ6MHLYM6H4R7NXR2JD6SHQQJILLQIJE73LACRCLIPSHOHVNWQC
7S6CIN7I56U6DYB2F2LKGA2BDDYY5X7W4P4USZPZP42PFFMCVMNQC
PTICQ76Q2AIWGRLUIN6XIQCDSSMQ55SZEYFPZ4FPZ2KWUQYVVL2AC
check_eq(App.screen.width, 300, 'F - test_resize_window/baseline/width')
check_eq(App.screen.height, 300, 'F - test_resize_window/baseline/height')
check_eq(Editor_state.left, Test_margin_left, 'F - test_resize_window/baseline/left_margin')
check_eq(Editor_state.right, 300 - Test_margin_right, 'F - test_resize_window/baseline/left_margin')
check_eq(App.screen.width, 300, 'baseline/width')
check_eq(App.screen.height, 300, 'baseline/height')
check_eq(Editor_state.left, Test_margin_left, 'baseline/left_margin')
check_eq(Editor_state.right, 300 - Test_margin_right, 'baseline/left_margin')
check_eq(App.screen.width, 200, 'F - test_resize_window/width')
check_eq(App.screen.height, 400, 'F - test_resize_window/height')
check_eq(Editor_state.left, Margin_left, 'F - test_resize_window/left_margin')
check_eq(Editor_state.right, 200-Margin_right, 'F - test_resize_window/right_margin')
check_eq(Editor_state.width, 200-Margin_left-Margin_right, 'F - test_resize_window/drawing_width')
check_eq(#Editor_state.lines, 3, 'F - test_drop_file/#lines')
check_eq(Editor_state.lines[1].data, 'abc', 'F - test_drop_file/lines:1')
check_eq(Editor_state.lines[2].data, 'def', 'F - test_drop_file/lines:2')
check_eq(Editor_state.lines[3].data, 'ghi', 'F - test_drop_file/lines:3')
check_eq(#Editor_state.lines, 3, '#lines')
check_eq(Editor_state.lines[1].data, 'abc', 'lines:1')
check_eq(Editor_state.lines[2].data, 'def', 'lines:2')
check_eq(Editor_state.lines[3].data, 'ghi', 'lines:3')
check_eq(App.screen.width, 200, 'width')
check_eq(App.screen.height, 400, 'height')
check_eq(Editor_state.left, Margin_left, 'left_margin')
check_eq(Editor_state.right, 200-Margin_right, 'right_margin')
check_eq(Editor_state.width, 200-Margin_left-Margin_right, 'drawing_width')
check_eq(#Editor_state.lines, 3, '#lines')
check_eq(Editor_state.lines[1].data, 'abc', 'lines:1')
check_eq(Editor_state.lines[2].data, 'def', 'lines:2')
check_eq(Editor_state.lines[3].data, 'ghi', 'lines:3')
check_eq(App.filesystem['foo'], 'abc\ndef\n', 'check')
check_eq(Editor_state.current_drawing_mode, 'line', 'baseline/drawing_mode')
check_eq(#Editor_state.lines, 2, 'baseline/#lines')
check_eq(Editor_state.lines[1].mode, 'drawing', 'baseline/mode')
check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'baseline/y')
check_eq(Editor_state.lines[1].h, 128, 'baseline/y')
check_eq(#Editor_state.lines[1].shapes, 0, 'baseline/#shapes')
check_eq(shape.mode, 'polygon', 'shape_mode')
-- start a stroke
edit.run_after_mouse_press(Editor_state, Editor_state.left+35, Editor_state.top+Drawing_padding_top+36, 1)
-- switch to polygon mode
edit.run_after_text_input(Editor_state, '5')
edit.run_after_mouse_release(Editor_state, Editor_state.left+55, Editor_state.top+Drawing_padding_top+26, 1)
local drawing = Editor_state.lines[1]
check_eq(#drawing.shapes, 1, '#shapes')
check_eq(#drawing.points, 2, 'vertices')
local shape = drawing.shapes[1]
check_eq(#shape.vertices, 3, 'vertices')
check_eq(p.x, 5, 'p1:x')
check_eq(p.y, 6, 'p1:y')
check_eq(p.x, 65, 'p2:x')
check_eq(p.y, 36, 'p2:y')
check_eq(p.x, 35, 'p3:x')
check_eq(p.y, 26, 'p3:y')
check_eq(shape.num_vertices, 5, 'vertices')
check_eq(Editor_state.current_drawing_mode, 'line', 'baseline/drawing_mode')
check_eq(#Editor_state.lines, 2, 'baseline/#lines')
check_eq(Editor_state.lines[1].mode, 'drawing', 'baseline/mode')
check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'baseline/y')
check_eq(Editor_state.lines[1].h, 128, 'baseline/y')
check_eq(#Editor_state.lines[1].shapes, 0, 'baseline/#shapes')
check_eq(#drawing.shapes, 1, '#shapes')
check_eq(#drawing.points, 5, '#points') -- currently includes every point added
check_eq(drawing.shapes[1].mode, 'square', 'shape_mode')
check_eq(#drawing.shapes[1].vertices, 4, 'vertices')
check_eq(p.x, 35, 'p1:x')
check_eq(p.y, 36, 'p1:y')
check_eq(p.x, 65, 'p2:x')
check_eq(p.y, 66, 'p2:y')
check_eq(p.x, 35, 'p3:x')
check_eq(p.y, 96, 'p3:y')
check_eq(p.x, 5, 'p4:x')
check_eq(p.y, 66, 'p4:y')
check_eq(#drawing.shapes, 1, 'baseline/#shapes')
check_eq(drawing.shapes[1].mode, 'polygon', 'baseline/mode')
check_eq(#drawing.shapes[1].vertices, 4, 'baseline/vertices')
check_eq(drawing.shapes[1].mode, 'polygon', 'shape')
check_eq(#drawing.shapes[1].vertices, 3, 'vertices')
check_eq(#drawing.shapes, 1, 'baseline/#shapes')
check_eq(drawing.shapes[1].mode, 'polygon', 'baseline/mode')
check_eq(#drawing.shapes[1].vertices, 3, 'baseline/vertices')
check_eq(drawing.shapes[1].mode, 'deleted', 'check')
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].h, 128, 'F - test_draw_polygon/baseline/y')
check_eq(#Editor_state.lines[1].shapes, 0, 'F - test_draw_polygon/baseline/#shapes')
-- start a stroke
edit.run_after_mouse_press(Editor_state, Editor_state.left+35, Editor_state.top+Drawing_padding_top+36, 1)
-- switch to polygon mode
edit.run_after_text_input(Editor_state, '5')
edit.run_after_mouse_release(Editor_state, Editor_state.left+55, Editor_state.top+Drawing_padding_top+26, 1)
local drawing = Editor_state.lines[1]
check_eq(#drawing.shapes, 1, 'F - test_draw_polygon/#shapes')
check_eq(#drawing.points, 2, 'F - test_draw_polygon/vertices')
local shape = drawing.shapes[1]
check_eq(shape.mode, 'polygon', 'F - test_draw_polygon/shape_mode')
check_eq(shape.num_vertices, 5, 'F - test_draw_polygon/vertices')
check_eq(#drawing.shapes, 1, '#shapes')
check_eq(#drawing.points, 3, 'vertices')