(draw1)
| 122184 | var context = (context = (0, _vegaCanvas.canvas)(1, 1)) ? context.getContext("2d") : null; |
| 122185 | const b = new Bounds(); |
| 122186 | function intersectPath(draw1) { |
| 122187 | return function(item, brush) { |
| 122188 | // rely on (inaccurate) bounds intersection if no context |
| 122189 | if (!context) return true; // add path to offscreen graphics context |
| 122190 | draw1(context, item); // get bounds intersection region |
| 122191 | b.clear().union(item.bounds).intersect(brush).round(); |
| 122192 | const { x1 , y1 , x2 , y2 } = b; // iterate over intersection region |
| 122193 | // perform fine grained inclusion test |
| 122194 | for(let y21 = y1; y21 <= y2; ++y21)for(let x22 = x1; x22 <= x2; ++x22){ |
| 122195 | if (context.isPointInPath(x22, y21)) return true; |
| 122196 | } |
| 122197 | // false if no hits in intersection region |
| 122198 | return false; |
| 122199 | }; |
| 122200 | } |
| 122201 | function intersectPoint(item, box) { |
| 122202 | return box.contains(item.x || 0, item.y || 0); |
| 122203 | } |
no test coverage detected