Apply fill and stroke only when set

This commit is contained in:
Andreas Hocevar
2017-12-26 19:34:27 +01:00
parent 72ca7b28c6
commit 8a73db9331

View File

@@ -989,7 +989,9 @@ ol.render.canvas.Replay.prototype.applyStroke = function(state) {
ol.render.canvas.Replay.prototype.updateFillStyle = function(state, applyFill, geometry) {
var fillStyle = state.fillStyle;
if (typeof fillStyle !== 'string' || state.currentFillStyle != fillStyle) {
applyFill.call(this, state, geometry);
if (fillStyle !== undefined) {
applyFill.call(this, state, geometry);
}
state.currentFillStyle = fillStyle;
}
};
@@ -1014,7 +1016,9 @@ ol.render.canvas.Replay.prototype.updateStrokeStyle = function(state, applyStrok
state.currentLineJoin != lineJoin ||
state.currentLineWidth != lineWidth ||
state.currentMiterLimit != miterLimit) {
applyStroke.call(this, state);
if (strokeStyle !== undefined) {
applyStroke.call(this, state);
}
state.currentStrokeStyle = strokeStyle;
state.currentLineCap = lineCap;
state.currentLineDash = lineDash;