MCPcopy
hub / github.com/paperjs/paper.js / testIntersections

Function testIntersections

test/tests/Path_Intersections.js:19–34  ·  view source on GitHub ↗
(intersections, results)

Source from the content-addressed store, hash-verified

17}
18
19function testIntersections(intersections, results) {
20 equals(intersections.length, results.length, 'intersections.length');
21 for (var i = 0, l = Math.min(results.length, intersections.length); i < l; i++) {
22 var inter = intersections[i];
23 var values = results[i];
24 var name = 'intersections[' + i + ']';
25 if (values.point != null)
26 equals(inter.point, new Point(values.point), name + '.point');
27 if (values.index != null)
28 equals(inter.index, values.index, name + '.index');
29 if (values.time != null)
30 equals(inter.time, values.time, name + '.time');
31 if (values.crossing != null)
32 equals(inter.isCrossing(), values.crossing, name + '.isCrossing()');
33 }
34}
35
36test('#565', function() {
37 var curve1 = new Curve(new Point(421.75945, 416.40481), new Point(-181.49299, -224.94946), new Point(44.52004, -194.13319), new Point(397.47615, 331.34712));

Callers 2

testFunction · 0.85

Calls 1

equalsFunction · 0.85

Tested by 1

testFunction · 0.68