From c5a2c2fd225896b5bdb943c9e9e93da5c4e95272 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 ce0b3edcd5..c83fe1fea3 100644 --- a/src/ol/render/canvas/Replay.js +++ b/src/ol/render/canvas/Replay.js @@ -993,7 +993,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; } }; @@ -1018,7 +1020,9 @@ _ol_render_canvas_Replay_.prototype.updateStrokeStyle = function(state, applyStr 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;