From 430aee95fd32d1fe8ec0fbfa28451394c3533806 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Mon, 12 Sep 2016 23:43:32 +0200 Subject: [PATCH] Only check for fill and stroke once --- src/ol/render/canvas/polygonreplay.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ol/render/canvas/polygonreplay.js b/src/ol/render/canvas/polygonreplay.js index d60ea7938c..d5f5c76ce2 100644 --- a/src/ol/render/canvas/polygonreplay.js +++ b/src/ol/render/canvas/polygonreplay.js @@ -80,9 +80,6 @@ ol.render.canvas.PolygonReplay.prototype.drawFlatCoordinatess_ = function(flatCo var fill = state.fillStyle !== undefined; var stroke = state.strokeStyle != undefined; var numEnds = ends.length; - if (!fill && !stroke) { - return ends[numEnds - 1]; - } var beginPathInstruction = [ol.render.canvas.Instruction.BEGIN_PATH]; this.instructions.push(beginPathInstruction); this.hitDetectionInstructions.push(beginPathInstruction); @@ -178,11 +175,9 @@ ol.render.canvas.PolygonReplay.prototype.drawCircle = function(circleGeometry, f ol.render.canvas.PolygonReplay.prototype.drawPolygon = function(polygonGeometry, feature) { var state = this.state_; ol.DEBUG && console.assert(state, 'state should not be null'); - var fillStyle = state.fillStyle; var strokeStyle = state.strokeStyle; - if (fillStyle === undefined && strokeStyle === undefined) { - return; - } + ol.DEBUG && console.assert(state.fillStyle === undefined && strokeStyle === undefined, + 'fillStyle or strokeStyle should be defined'); if (strokeStyle !== undefined) { ol.DEBUG && console.assert(state.lineWidth !== undefined, 'state.lineWidth should be defined');