(ctor, applyMatrix)
| 113 | |
| 114 | test('intersecting paths with applyMatrix = true / false', function() { |
| 115 | function test(ctor, applyMatrix) { |
| 116 | var name = ctor.name.toLowerCase(); |
| 117 | |
| 118 | var item1 = new ctor.Rectangle({ |
| 119 | point: [0, 0], |
| 120 | size: [200, 200], |
| 121 | applyMatrix: applyMatrix |
| 122 | }); |
| 123 | |
| 124 | var offset = new Point(200, 200); |
| 125 | |
| 126 | item1.translate(offset); |
| 127 | |
| 128 | var item2 = new ctor.Rectangle({ |
| 129 | point: [100, 100], |
| 130 | size: [200, 200], |
| 131 | applyMatrix: applyMatrix |
| 132 | }); |
| 133 | |
| 134 | if (!applyMatrix) |
| 135 | offset = new Point(0, 0); |
| 136 | |
| 137 | if (ctor === Path) { |
| 138 | testIntersections(item1.getIntersections(item2), [{ |
| 139 | point: new Point(0, 100).add(offset), index: 0, time: 0.5, |
| 140 | crossing: true |
| 141 | }, { |
| 142 | point: new Point(100, 0).add(offset), index: 1, time: 0.5, |
| 143 | crossing: true |
| 144 | }]); |
| 145 | } |
| 146 | |
| 147 | equals(item1.intersects(item2), true, |
| 148 | name + '1.intersects(' + name + '2);'); |
| 149 | } |
| 150 | |
| 151 | test(Path, true); |
| 152 | test(Path, false); |
no test coverage detected