@@ -24,28 +24,28 @@ describe('r2.Rect', () => {
24
24
test ( 'constructors' , ( t ) => {
25
25
ok (
26
26
Rect . fromCenterSize ( new Point ( 0.3 , 0.5 ) , new Point ( 0.2 , 0.4 ) ) . approxEqual (
27
- Rect . fromPoints ( new Point ( 0.2 , 0.3 ) , new Point ( 0.4 , 0.7 ) ) ,
28
- ) ,
27
+ Rect . fromPoints ( new Point ( 0.2 , 0.3 ) , new Point ( 0.4 , 0.7 ) )
28
+ )
29
29
)
30
30
ok (
31
31
Rect . fromCenterSize ( new Point ( 1 , 0.1 ) , new Point ( 0 , 2 ) ) . approxEqual (
32
- Rect . fromPoints ( new Point ( 1 , - 0.9 ) , new Point ( 1 , 1.1 ) ) ,
33
- ) ,
32
+ Rect . fromPoints ( new Point ( 1 , - 0.9 ) , new Point ( 1 , 1.1 ) )
33
+ )
34
34
)
35
35
ok (
36
36
Rect . fromPoints ( new Point ( 0.1 , 0 ) , new Point ( 0.25 , 1 ) ) . approxEqual (
37
- Rect . fromPoints ( new Point ( 0.1 , 0 ) , new Point ( 0.25 , 1 ) ) ,
38
- ) ,
37
+ Rect . fromPoints ( new Point ( 0.1 , 0 ) , new Point ( 0.25 , 1 ) )
38
+ )
39
39
)
40
40
ok (
41
41
Rect . fromPoints ( new Point ( 0.15 , 0.3 ) , new Point ( 0.35 , 0.9 ) ) . approxEqual (
42
- Rect . fromPoints ( new Point ( 0.15 , 0.9 ) , new Point ( 0.35 , 0.3 ) ) ,
43
- ) ,
42
+ Rect . fromPoints ( new Point ( 0.15 , 0.9 ) , new Point ( 0.35 , 0.3 ) )
43
+ )
44
44
)
45
45
ok (
46
46
Rect . fromPoints ( new Point ( 0.12 , 0 ) , new Point ( 0.83 , 0.5 ) ) . approxEqual (
47
- Rect . fromPoints ( new Point ( 0.83 , 0 ) , new Point ( 0.12 , 0.5 ) ) ,
48
- ) ,
47
+ Rect . fromPoints ( new Point ( 0.83 , 0 ) , new Point ( 0.12 , 0.5 ) )
48
+ )
49
49
)
50
50
} )
51
51
@@ -88,18 +88,18 @@ describe('r2.Rect', () => {
88
88
ok ( ! RECT . contains ( Rect . fromPoints ( new Point ( 0.45 , 0.1 ) , new Point ( 0.7 , 0.25 ) ) ) )
89
89
ok (
90
90
! Rect . fromPoints ( new Point ( 0.1 , 0.2 ) , new Point ( 0.1 , 0.3 ) ) . contains (
91
- Rect . fromPoints ( new Point ( 0.15 , 0.7 ) , new Point ( 0.2 , 0.8 ) ) ,
92
- ) ,
91
+ Rect . fromPoints ( new Point ( 0.15 , 0.7 ) , new Point ( 0.2 , 0.8 ) )
92
+ )
93
93
)
94
94
ok (
95
95
! Rect . fromPoints ( new Point ( 0.1 , 0.2 ) , new Point ( 0.4 , 0.5 ) ) . contains (
96
- Rect . fromPoints ( new Point ( 0 , 0 ) , new Point ( 0.2 , 0.1 ) ) ,
97
- ) ,
96
+ Rect . fromPoints ( new Point ( 0 , 0 ) , new Point ( 0.2 , 0.1 ) )
97
+ )
98
98
)
99
99
ok (
100
100
! Rect . fromPoints ( new Point ( 0.0 , 0.0 ) , new Point ( 0.1 , 0.3 ) ) . contains (
101
- Rect . fromPoints ( new Point ( 0.2 , 0.1 ) , new Point ( 0.3 , 0.4 ) ) ,
102
- ) ,
101
+ Rect . fromPoints ( new Point ( 0.2 , 0.1 ) , new Point ( 0.3 , 0.4 ) )
102
+ )
103
103
)
104
104
} )
105
105
@@ -112,18 +112,18 @@ describe('r2.Rect', () => {
112
112
ok ( ! RECT . interiorContains ( Rect . fromPoints ( new Point ( 0.45 , 0.1 ) , new Point ( 0.7 , 0.25 ) ) ) )
113
113
ok (
114
114
! Rect . fromPoints ( new Point ( 0.1 , 0.2 ) , new Point ( 0.1 , 0.3 ) ) . interiorContains (
115
- Rect . fromPoints ( new Point ( 0.15 , 0.7 ) , new Point ( 0.2 , 0.8 ) ) ,
116
- ) ,
115
+ Rect . fromPoints ( new Point ( 0.15 , 0.7 ) , new Point ( 0.2 , 0.8 ) )
116
+ )
117
117
)
118
118
ok (
119
119
! Rect . fromPoints ( new Point ( 0.1 , 0.2 ) , new Point ( 0.4 , 0.5 ) ) . interiorContains (
120
- Rect . fromPoints ( new Point ( 0 , 0 ) , new Point ( 0.2 , 0.1 ) ) ,
121
- ) ,
120
+ Rect . fromPoints ( new Point ( 0 , 0 ) , new Point ( 0.2 , 0.1 ) )
121
+ )
122
122
)
123
123
ok (
124
124
! Rect . fromPoints ( new Point ( 0.0 , 0.0 ) , new Point ( 0.1 , 0.3 ) ) . interiorContains (
125
- Rect . fromPoints ( new Point ( 0.2 , 0.1 ) , new Point ( 0.3 , 0.4 ) ) ,
126
- ) ,
125
+ Rect . fromPoints ( new Point ( 0.2 , 0.1 ) , new Point ( 0.3 , 0.4 ) )
126
+ )
127
127
)
128
128
} )
129
129
@@ -136,18 +136,18 @@ describe('r2.Rect', () => {
136
136
ok ( RECT . intersects ( Rect . fromPoints ( new Point ( 0.45 , 0.1 ) , new Point ( 0.7 , 0.25 ) ) ) )
137
137
ok (
138
138
! Rect . fromPoints ( new Point ( 0.1 , 0.2 ) , new Point ( 0.1 , 0.3 ) ) . intersects (
139
- Rect . fromPoints ( new Point ( 0.15 , 0.7 ) , new Point ( 0.2 , 0.8 ) ) ,
140
- ) ,
139
+ Rect . fromPoints ( new Point ( 0.15 , 0.7 ) , new Point ( 0.2 , 0.8 ) )
140
+ )
141
141
)
142
142
ok (
143
143
! Rect . fromPoints ( new Point ( 0.1 , 0.2 ) , new Point ( 0.4 , 0.5 ) ) . intersects (
144
- Rect . fromPoints ( new Point ( 0 , 0 ) , new Point ( 0.2 , 0.1 ) ) ,
145
- ) ,
144
+ Rect . fromPoints ( new Point ( 0 , 0 ) , new Point ( 0.2 , 0.1 ) )
145
+ )
146
146
)
147
147
ok (
148
148
! Rect . fromPoints ( new Point ( 0.0 , 0.0 ) , new Point ( 0.1 , 0.3 ) ) . intersects (
149
- Rect . fromPoints ( new Point ( 0.2 , 0.1 ) , new Point ( 0.3 , 0.4 ) ) ,
150
- ) ,
149
+ Rect . fromPoints ( new Point ( 0.2 , 0.1 ) , new Point ( 0.3 , 0.4 ) )
150
+ )
151
151
)
152
152
} )
153
153
@@ -160,18 +160,18 @@ describe('r2.Rect', () => {
160
160
ok ( ! RECT . interiorIntersects ( Rect . fromPoints ( new Point ( 0.45 , 0.1 ) , new Point ( 0.7 , 0.25 ) ) ) )
161
161
ok (
162
162
! Rect . fromPoints ( new Point ( 0.1 , 0.2 ) , new Point ( 0.1 , 0.3 ) ) . interiorIntersects (
163
- Rect . fromPoints ( new Point ( 0.15 , 0.7 ) , new Point ( 0.2 , 0.8 ) ) ,
164
- ) ,
163
+ Rect . fromPoints ( new Point ( 0.15 , 0.7 ) , new Point ( 0.2 , 0.8 ) )
164
+ )
165
165
)
166
166
ok (
167
167
! Rect . fromPoints ( new Point ( 0.1 , 0.2 ) , new Point ( 0.4 , 0.5 ) ) . interiorIntersects (
168
- Rect . fromPoints ( new Point ( 0 , 0 ) , new Point ( 0.2 , 0.1 ) ) ,
169
- ) ,
168
+ Rect . fromPoints ( new Point ( 0 , 0 ) , new Point ( 0.2 , 0.1 ) )
169
+ )
170
170
)
171
171
ok (
172
172
! Rect . fromPoints ( new Point ( 0.0 , 0.0 ) , new Point ( 0.1 , 0.3 ) ) . interiorIntersects (
173
- Rect . fromPoints ( new Point ( 0.2 , 0.1 ) , new Point ( 0.3 , 0.4 ) ) ,
174
- ) ,
173
+ Rect . fromPoints ( new Point ( 0.2 , 0.1 ) , new Point ( 0.3 , 0.4 ) )
174
+ )
175
175
)
176
176
} )
177
177
@@ -181,33 +181,33 @@ describe('r2.Rect', () => {
181
181
deepEqual ( RECT . union ( RECT_NE ) , RECT )
182
182
deepEqual (
183
183
RECT . union ( Rect . fromPoints ( new Point ( 0.45 , 0.1 ) , new Point ( 0.75 , 0.3 ) ) ) ,
184
- Rect . fromPoints ( new Point ( 0 , 0.1 ) , new Point ( 0.75 , 0.75 ) ) ,
184
+ Rect . fromPoints ( new Point ( 0 , 0.1 ) , new Point ( 0.75 , 0.75 ) )
185
185
)
186
186
deepEqual (
187
187
RECT . union ( Rect . fromPoints ( new Point ( 0.5 , 0.1 ) , new Point ( 0.7 , 0.3 ) ) ) ,
188
- Rect . fromPoints ( new Point ( 0 , 0.1 ) , new Point ( 0.7 , 0.75 ) ) ,
188
+ Rect . fromPoints ( new Point ( 0 , 0.1 ) , new Point ( 0.7 , 0.75 ) )
189
189
)
190
190
deepEqual (
191
191
RECT . union ( Rect . fromPoints ( new Point ( 0.45 , 0.1 ) , new Point ( 0.7 , 0.25 ) ) ) ,
192
- Rect . fromPoints ( new Point ( 0 , 0.1 ) , new Point ( 0.7 , 0.75 ) ) ,
192
+ Rect . fromPoints ( new Point ( 0 , 0.1 ) , new Point ( 0.7 , 0.75 ) )
193
193
)
194
194
deepEqual (
195
195
Rect . fromPoints ( new Point ( 0.1 , 0.2 ) , new Point ( 0.1 , 0.3 ) ) . union (
196
- Rect . fromPoints ( new Point ( 0.15 , 0.7 ) , new Point ( 0.2 , 0.8 ) ) ,
196
+ Rect . fromPoints ( new Point ( 0.15 , 0.7 ) , new Point ( 0.2 , 0.8 ) )
197
197
) ,
198
- Rect . fromPoints ( new Point ( 0.1 , 0.2 ) , new Point ( 0.2 , 0.8 ) ) ,
198
+ Rect . fromPoints ( new Point ( 0.1 , 0.2 ) , new Point ( 0.2 , 0.8 ) )
199
199
)
200
200
deepEqual (
201
201
Rect . fromPoints ( new Point ( 0.1 , 0.2 ) , new Point ( 0.4 , 0.5 ) ) . union (
202
- Rect . fromPoints ( new Point ( 0 , 0 ) , new Point ( 0.2 , 0.1 ) ) ,
202
+ Rect . fromPoints ( new Point ( 0 , 0 ) , new Point ( 0.2 , 0.1 ) )
203
203
) ,
204
- Rect . fromPoints ( new Point ( 0 , 0 ) , new Point ( 0.4 , 0.5 ) ) ,
204
+ Rect . fromPoints ( new Point ( 0 , 0 ) , new Point ( 0.4 , 0.5 ) )
205
205
)
206
206
deepEqual (
207
207
Rect . fromPoints ( new Point ( 0.0 , 0.0 ) , new Point ( 0.1 , 0.3 ) ) . union (
208
- Rect . fromPoints ( new Point ( 0.2 , 0.1 ) , new Point ( 0.3 , 0.4 ) ) ,
208
+ Rect . fromPoints ( new Point ( 0.2 , 0.1 ) , new Point ( 0.3 , 0.4 ) )
209
209
) ,
210
- Rect . fromPoints ( new Point ( 0 , 0 ) , new Point ( 0.3 , 0.4 ) ) ,
210
+ Rect . fromPoints ( new Point ( 0 , 0 ) , new Point ( 0.3 , 0.4 ) )
211
211
)
212
212
} )
213
213
@@ -217,33 +217,33 @@ describe('r2.Rect', () => {
217
217
deepEqual ( RECT . intersection ( RECT_NE ) , RECT_NE )
218
218
deepEqual (
219
219
RECT . intersection ( Rect . fromPoints ( new Point ( 0.45 , 0.1 ) , new Point ( 0.75 , 0.3 ) ) ) ,
220
- Rect . fromPoints ( new Point ( 0.45 , 0.25 ) , new Point ( 0.5 , 0.3 ) ) ,
220
+ Rect . fromPoints ( new Point ( 0.45 , 0.25 ) , new Point ( 0.5 , 0.3 ) )
221
221
)
222
222
deepEqual (
223
223
RECT . intersection ( Rect . fromPoints ( new Point ( 0.5 , 0.1 ) , new Point ( 0.7 , 0.3 ) ) ) ,
224
- Rect . fromPoints ( new Point ( 0.5 , 0.25 ) , new Point ( 0.5 , 0.3 ) ) ,
224
+ Rect . fromPoints ( new Point ( 0.5 , 0.25 ) , new Point ( 0.5 , 0.3 ) )
225
225
)
226
226
deepEqual (
227
227
RECT . intersection ( Rect . fromPoints ( new Point ( 0.45 , 0.1 ) , new Point ( 0.7 , 0.25 ) ) ) ,
228
- Rect . fromPoints ( new Point ( 0.45 , 0.25 ) , new Point ( 0.5 , 0.25 ) ) ,
228
+ Rect . fromPoints ( new Point ( 0.45 , 0.25 ) , new Point ( 0.5 , 0.25 ) )
229
229
)
230
230
deepEqual (
231
231
Rect . fromPoints ( new Point ( 0.1 , 0.2 ) , new Point ( 0.1 , 0.3 ) ) . intersection (
232
- Rect . fromPoints ( new Point ( 0.15 , 0.7 ) , new Point ( 0.2 , 0.8 ) ) ,
232
+ Rect . fromPoints ( new Point ( 0.15 , 0.7 ) , new Point ( 0.2 , 0.8 ) )
233
233
) ,
234
- EMPTY ,
234
+ EMPTY
235
235
)
236
236
deepEqual (
237
237
Rect . fromPoints ( new Point ( 0.1 , 0.2 ) , new Point ( 0.4 , 0.5 ) ) . intersection (
238
- Rect . fromPoints ( new Point ( 0 , 0 ) , new Point ( 0.2 , 0.1 ) ) ,
238
+ Rect . fromPoints ( new Point ( 0 , 0 ) , new Point ( 0.2 , 0.1 ) )
239
239
) ,
240
- EMPTY ,
240
+ EMPTY
241
241
)
242
242
deepEqual (
243
243
Rect . fromPoints ( new Point ( 0.0 , 0.0 ) , new Point ( 0.1 , 0.3 ) ) . intersection (
244
- Rect . fromPoints ( new Point ( 0.2 , 0.1 ) , new Point ( 0.3 , 0.4 ) ) ,
244
+ Rect . fromPoints ( new Point ( 0.2 , 0.1 ) , new Point ( 0.3 , 0.4 ) )
245
245
) ,
246
- EMPTY ,
246
+ EMPTY
247
247
)
248
248
} )
249
249
@@ -282,17 +282,17 @@ describe('r2.Rect', () => {
282
282
ok (
283
283
Rect . fromPoints ( new Point ( 0.2 , 0.4 ) , new Point ( 0.3 , 0.7 ) )
284
284
. expanded ( new Point ( 0.1 , 0.3 ) )
285
- . approxEqual ( Rect . fromPoints ( new Point ( 0.1 , 0.1 ) , new Point ( 0.4 , 1.0 ) ) ) ,
285
+ . approxEqual ( Rect . fromPoints ( new Point ( 0.1 , 0.1 ) , new Point ( 0.4 , 1.0 ) ) )
286
286
)
287
287
ok (
288
288
Rect . fromPoints ( new Point ( 0.2 , 0.4 ) , new Point ( 0.3 , 0.7 ) )
289
289
. expanded ( new Point ( 0.1 , - 0.1 ) )
290
- . approxEqual ( Rect . fromPoints ( new Point ( 0.1 , 0.5 ) , new Point ( 0.4 , 0.6 ) ) ) ,
290
+ . approxEqual ( Rect . fromPoints ( new Point ( 0.1 , 0.5 ) , new Point ( 0.4 , 0.6 ) ) )
291
291
)
292
292
ok (
293
293
Rect . fromPoints ( new Point ( 0.2 , 0.4 ) , new Point ( 0.3 , 0.7 ) )
294
294
. expanded ( new Point ( 0.1 , 0.1 ) )
295
- . approxEqual ( Rect . fromPoints ( new Point ( 0.1 , 0.3 ) , new Point ( 0.4 , 0.8 ) ) ) ,
295
+ . approxEqual ( Rect . fromPoints ( new Point ( 0.1 , 0.3 ) , new Point ( 0.4 , 0.8 ) ) )
296
296
)
297
297
} )
298
298
} )
0 commit comments