Save context state only when it's actually necessary
This commit is contained in:
@@ -144,8 +144,6 @@ ol.reproj.render = function(width, height, pixelRatio,
|
|||||||
var targetTopLeft = ol.extent.getTopLeft(targetExtent);
|
var targetTopLeft = ol.extent.getTopLeft(targetExtent);
|
||||||
|
|
||||||
triangulation.getTriangles().forEach(function(triangle, i, arr) {
|
triangulation.getTriangles().forEach(function(triangle, i, arr) {
|
||||||
context.save();
|
|
||||||
|
|
||||||
/* Calculate affine transform (src -> dst)
|
/* Calculate affine transform (src -> dst)
|
||||||
* Resulting matrix can be used to transform coordinate
|
* Resulting matrix can be used to transform coordinate
|
||||||
* from `sourceProjection` to destination pixels.
|
* from `sourceProjection` to destination pixels.
|
||||||
@@ -199,6 +197,7 @@ ol.reproj.render = function(width, height, pixelRatio,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
context.save();
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
if (ol.reproj.browserAntialiasesClip_) {
|
if (ol.reproj.browserAntialiasesClip_) {
|
||||||
var centroidX = (u0 + u1 + u2) / 3, centroidY = (v0 + v1 + v2) / 3;
|
var centroidX = (u0 + u1 + u2) / 3, centroidY = (v0 + v1 + v2) / 3;
|
||||||
|
|||||||
Reference in New Issue
Block a user