Skip to content

Commit 0a4ba75

Browse files
committed
chore(): inline bezierBBoxIntersects
1 parent a9864e2 commit 0a4ba75

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

intersect.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,6 @@ function fixError(number) {
280280
return Math.round(number * 100000000000) / 100000000000;
281281
}
282282

283-
function bezierBBoxIntersects(bez1, bez2) {
284-
var bbox1 = bezierBBox(bez1),
285-
bbox2 = bezierBBox(bez2);
286-
287-
return isBBoxIntersect(bbox1, bbox2);
288-
}
289-
290283
/**
291284
*
292285
* @param {import("./intersect").PathComponent} bez1
@@ -398,7 +391,7 @@ export default function findPathIntersections(path1, path2, justCount) {
398391
path1 = path1.parsed ? path1 : getPathCurve(path1);
399392
path2 = path2.parsed ? path2 : getPathCurve(path2);
400393

401-
var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2,
394+
var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2, bbox1, bbox2,
402395
res = justCount ? 0 : [];
403396

404397
for (var i = 0, ii = path1.length; i < ii; i++) {
@@ -437,7 +430,10 @@ export default function findPathIntersections(path1, path2, justCount) {
437430
y2 = y2m;
438431
}
439432

440-
var intr = bezierBBoxIntersects(bez1, bez2) ?
433+
bbox1 = bezierBBox(bez1);
434+
bbox2 = bezierBBox(bez2);
435+
436+
var intr = isBBoxIntersect(bbox1, bbox2) ?
441437
findBezierIntersections(bez1, bez2, justCount) :
442438
justCount ? 0 : [];
443439

0 commit comments

Comments
 (0)