Merge pull request #5407 from wiserim/fix-geom-intersects-triangle-to-line

Fix: TriangleToLine() not checking start / end point of line properly.
This commit is contained in:
Richard Davey 2020-11-24 09:08:08 +00:00 committed by GitHub
commit 3529e2c611
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,7 @@
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var Contains = require('../triangle/Contains');
var ContainsPoint = require('../triangle/ContainsPoint');
var LineToLine = require('./LineToLine');
/**
@ -23,7 +23,7 @@ var LineToLine = require('./LineToLine');
var TriangleToLine = function (triangle, line)
{
// If the Triangle contains either the start or end point of the line, it intersects
if (Contains(triangle, line.getPointA()) || Contains(triangle, line.getPointB()))
if (ContainsPoint(triangle, line.getPointA()) || ContainsPoint(triangle, line.getPointB()))
{
return true;
}