Pass destination extent to avoid garbage generation

This commit is contained in:
Frederic Junod
2018-02-07 14:52:54 +01:00
parent 76cd52325d
commit b2d3d142f0
2 changed files with 3 additions and 1 deletions

View File

@@ -97,7 +97,7 @@ const VectorImageTile = function(tileCoord, state, sourceRevision, format,
sourceTileGrid.getTileCoordExtent(sourceTileCoord)); sourceTileGrid.getTileCoordExtent(sourceTileCoord));
const sourceExtent = sourceTileGrid.getExtent(); const sourceExtent = sourceTileGrid.getExtent();
if (sourceExtent) { if (sourceExtent) {
sharedExtent = getIntersection(sharedExtent, sourceExtent); sharedExtent = getIntersection(sharedExtent, sourceExtent, sharedExtent);
} }
if (getWidth(sharedExtent) / resolution >= 0.5 && if (getWidth(sharedExtent) / resolution >= 0.5 &&
getHeight(sharedExtent) / resolution >= 0.5) { getHeight(sharedExtent) / resolution >= 0.5) {

View File

@@ -593,6 +593,8 @@ export function getIntersection(extent1, extent2, opt_extent) {
} else { } else {
intersection[3] = extent2[3]; intersection[3] = extent2[3];
} }
} else {
createOrUpdateEmpty(intersection);
} }
return intersection; return intersection;
} }