From 8a73db9331be7a28cd22b4c85f24fc30b9162f55 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Tue, 26 Dec 2017 19:34:27 +0100 Subject: [PATCH] Apply fill and stroke only when set --- src/ol/render/canvas/replay.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ol/render/canvas/replay.js b/src/ol/render/canvas/replay.js index 38923817d8..a017ddad79 100644 --- a/src/ol/render/canvas/replay.js +++ b/src/ol/render/canvas/replay.js @@ -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;