Fix WebGL PolygonReplay#bridgeHole_
This commit is contained in:
@@ -211,6 +211,7 @@ ol.render.webgl.PolygonReplay.prototype.classifyPoints_ = function(list, rtree,
|
||||
*/
|
||||
ol.render.webgl.PolygonReplay.prototype.bridgeHole_ = function(hole, holeMaxX,
|
||||
list, listMaxX, rtree) {
|
||||
this.classifyPoints_(hole, rtree, true);
|
||||
var seg = hole.firstItem();
|
||||
while (seg.p1.x !== holeMaxX) {
|
||||
seg = hole.nextItem();
|
||||
@@ -227,7 +228,7 @@ ol.render.webgl.PolygonReplay.prototype.bridgeHole_ = function(hole, holeMaxX,
|
||||
var intersectingSegments = this.getIntersections_({p0: p1, p1: p2}, rtree, true);
|
||||
for (i = 0, ii = intersectingSegments.length; i < ii; ++i) {
|
||||
var currSeg = intersectingSegments[i];
|
||||
if (currSeg.p0 !== p1 && currSeg.p1 !== p1) {
|
||||
if (currSeg.p0.reflex === undefined) {
|
||||
var intersection = this.calculateIntersection_(p1, p2, currSeg.p0,
|
||||
currSeg.p1, true);
|
||||
var dist = Math.abs(p1.x - intersection[0]);
|
||||
@@ -238,8 +239,12 @@ ol.render.webgl.PolygonReplay.prototype.bridgeHole_ = function(hole, holeMaxX,
|
||||
}
|
||||
}
|
||||
}
|
||||
if (minDist === Infinity) {
|
||||
return;
|
||||
}
|
||||
bestPoint = seg.p1;
|
||||
|
||||
if (minDist > 0) {
|
||||
var pointsInTriangle = this.getPointsInTriangle_(p1, p5, seg.p1, rtree);
|
||||
if (pointsInTriangle.length) {
|
||||
var theta = Infinity;
|
||||
@@ -252,6 +257,7 @@ ol.render.webgl.PolygonReplay.prototype.bridgeHole_ = function(hole, holeMaxX,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
seg = list.firstItem();
|
||||
while (seg.p1 !== bestPoint) {
|
||||
|
||||
Reference in New Issue
Block a user