From b12502a2691cf62d617622f07cf2da577e660873 Mon Sep 17 00:00:00 2001 From: Michael Enion Date: Tue, 23 Jul 2024 07:35:36 -0700 Subject: [PATCH] Allow passthrough of pregenerated Polygon edges --- PIXI/Polygon.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PIXI/Polygon.js b/PIXI/Polygon.js index 97f62d4..4ed6d17 100644 --- a/PIXI/Polygon.js +++ b/PIXI/Polygon.js @@ -232,10 +232,10 @@ function linesCross(lines) { * return true. * @returns {boolean} True if intersects. */ -function lineSegmentIntersects(a, b, { inside = false } = {}) { +function lineSegmentIntersects(a, b, { edges, inside = false } = {}) { if (this.contains(a.x, a.y) && this.contains(b.x, b.y) ) return inside; - const edges = this.iterateEdges({ close: true }); + edges ??= this.iterateEdges({ close: true }); for ( const edge of edges ) { if ( foundry.utils.lineSegmentIntersects(a, b, edge.A, edge.B) ) return true; }