(dim, limit0, limit1)
| 203 | // out BEYOND the clipping rect, by a maximum of a factor of 2, so that |
| 204 | // the midpoint line is drawn in the right place |
| 205 | function getABAEdgeIntersections(dim, limit0, limit1) { |
| 206 | return function(pt1, pt2) { |
| 207 | var ptInt1 = onlyConstrainedPoint(pt1); |
| 208 | var ptInt2 = onlyConstrainedPoint(pt2); |
| 209 | |
| 210 | var out = []; |
| 211 | if(ptInt1 && ptInt2 && sameEdge(ptInt1, ptInt2)) return out; |
| 212 | |
| 213 | if(ptInt1) out.push(ptInt1); |
| 214 | if(ptInt2) out.push(ptInt2); |
| 215 | |
| 216 | var midShift = 2 * Lib.constrain((pt1[dim] + pt2[dim]) / 2, limit0, limit1) - |
| 217 | ((ptInt1 || pt1)[dim] + (ptInt2 || pt2)[dim]); |
| 218 | if(midShift) { |
| 219 | var ptToAlter; |
| 220 | if(ptInt1 && ptInt2) { |
| 221 | ptToAlter = (midShift > 0 === ptInt1[dim] > ptInt2[dim]) ? ptInt1 : ptInt2; |
| 222 | } else ptToAlter = ptInt1 || ptInt2; |
| 223 | |
| 224 | ptToAlter[dim] += midShift; |
| 225 | } |
| 226 | |
| 227 | return out; |
| 228 | }; |
| 229 | } |
| 230 | |
| 231 | var getEdgeIntersections; |
| 232 | if(shape === 'linear' || shape === 'spline') { |
no test coverage detected
searching dependent graphs…