Skip to content

Commit

Permalink
Allow passthrough of pregenerated Polygon edges
Browse files Browse the repository at this point in the history
  • Loading branch information
caewok committed Jul 23, 2024
1 parent d966bef commit b12502a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PIXI/Polygon.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b12502a

Please sign in to comment.