Merge pull request #5708 from ahocevar/no-closepath

Remove unnecessary closePath() instructions
This commit is contained in:
Andreas Hocevar
2016-08-25 17:05:52 +02:00
committed by GitHub
5 changed files with 119 additions and 25 deletions
+6 -7
View File
@@ -217,15 +217,14 @@ ol.reproj.render = function(width, height, pixelRatio,
var p1 = ol.reproj.enlargeClipPoint_(centroidX, centroidY, u1, v1);
var p2 = ol.reproj.enlargeClipPoint_(centroidX, centroidY, u2, v2);
context.moveTo(p0[0], p0[1]);
context.lineTo(p1[0], p1[1]);
context.moveTo(p1[0], p1[1]);
context.lineTo(p0[0], p0[1]);
context.lineTo(p2[0], p2[1]);
} else {
context.moveTo(u0, v0);
context.lineTo(u1, v1);
context.moveTo(u1, v1);
context.lineTo(u0, v0);
context.lineTo(u2, v2);
}
context.closePath();
context.clip();
context.transform(
@@ -257,8 +256,8 @@ ol.reproj.render = function(width, height, pixelRatio,
v2 = -(target[2][1] - targetTopLeft[1]) / targetResolution;
context.beginPath();
context.moveTo(u0, v0);
context.lineTo(u1, v1);
context.moveTo(u1, v1);
context.lineTo(u0, v0);
context.lineTo(u2, v2);
context.closePath();
context.stroke();