-
Notifications
You must be signed in to change notification settings - Fork 23
/
test_data.js
113 lines (107 loc) · 2.08 KB
/
test_data.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
let testData = {
'home': {
svg:
`
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 3L4 9v12h16V9l-8-6zm6 16h-3v-6H9v6H6v-9l6-4.5 6 4.5v9z"/></svg>
`,
expected:
`CANVAS_DIMENSIONS, 24,
FILL_RULE_NONZERO,
MOVE_TO, 12, 3,
LINE_TO, 4, 9,
R_V_LINE_TO, 12,
R_H_LINE_TO, 16,
V_LINE_TO, 9,
R_LINE_TO, -8, -6,
CLOSE,
R_MOVE_TO, 6, 16,
R_H_LINE_TO, -3,
R_V_LINE_TO, -6,
H_LINE_TO, 9,
R_V_LINE_TO, 6,
H_LINE_TO, 6,
R_V_LINE_TO, -9,
R_LINE_TO, 6, -4.5f,
R_LINE_TO, 6, 4.5f,
R_V_LINE_TO, 9,
CLOSE`},
'color_home': {
svg:
`
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path fill="#ABC" d="M12 3L4 9v12h16V9l-8-6zm6 16h-3v-6H9v6H6v-9l6-4.5 6 4.5v9z"/></svg>
`,
expected:
`CANVAS_DIMENSIONS, 24,
PATH_COLOR_ARGB, 0xFF, 0xAA, 0xBB, 0xCC,
FILL_RULE_NONZERO,
MOVE_TO, 12, 3,
LINE_TO, 4, 9,
R_V_LINE_TO, 12,
R_H_LINE_TO, 16,
V_LINE_TO, 9,
R_LINE_TO, -8, -6,
CLOSE,
R_MOVE_TO, 6, 16,
R_H_LINE_TO, -3,
R_V_LINE_TO, -6,
H_LINE_TO, 9,
R_V_LINE_TO, 6,
H_LINE_TO, 6,
R_V_LINE_TO, -9,
R_LINE_TO, 6, -4.5f,
R_LINE_TO, 6, 4.5f,
R_V_LINE_TO, 9,
CLOSE`},
'implicit_lineto': {
svg:
`
<svg xmlns="http://www.w3.org/2000/svg" width="16"><path d="M1,2 3,4"/></svg>
`,
expected:
`CANVAS_DIMENSIONS, 16,
FILL_RULE_NONZERO,
MOVE_TO, 1, 2,
LINE_TO, 3, 4,
CLOSE`},
'implicit_r_lineto': {
svg:
`
<svg xmlns="http://www.w3.org/2000/svg" width="16"><path d="m1 2 4 3 1 1Z"/></svg>
`,
expected:
`CANVAS_DIMENSIONS, 16,
FILL_RULE_NONZERO,
R_MOVE_TO, 1, 2,
R_LINE_TO, 4, 3,
R_LINE_TO, 1, 1,
CLOSE`},
'repeat_r_vh_lineto': {
svg:
`
<svg xmlns="http://www.w3.org/2000/svg" width="16"><path d="h1 2 4V3 1 1Z"/></svg>
`,
expected:
`CANVAS_DIMENSIONS, 16,
FILL_RULE_NONZERO,
R_H_LINE_TO, 1,
R_H_LINE_TO, 2,
R_H_LINE_TO, 4,
V_LINE_TO, 3,
V_LINE_TO, 1,
V_LINE_TO, 1,
CLOSE`},
'fill_rule_evenodd': {
svg:
`
<svg xmlns="http://www.w3.org/2000/svg" width="16"><path fill-rule="evenodd" d="h1 2 4V3 1 1Z"/></svg>
`,
expected:
`CANVAS_DIMENSIONS, 16,
R_H_LINE_TO, 1,
R_H_LINE_TO, 2,
R_H_LINE_TO, 4,
V_LINE_TO, 3,
V_LINE_TO, 1,
V_LINE_TO, 1,
CLOSE`},
};