From 112fae228a70d991338e66b6241f0317295f0e86 Mon Sep 17 00:00:00 2001 From: GaborFarkas Date: Thu, 7 Jul 2016 18:13:26 +0200 Subject: [PATCH] Sanity check fill colors. --- src/ol/render/webgl/imagereplay/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ol/render/webgl/imagereplay/index.js b/src/ol/render/webgl/imagereplay/index.js index 249d7e4408..71dcbe8d43 100644 --- a/src/ol/render/webgl/imagereplay/index.js +++ b/src/ol/render/webgl/imagereplay/index.js @@ -1936,9 +1936,10 @@ ol.render.webgl.PolygonReplay.prototype.setFillStyle_ = function(gl, color) { ol.render.webgl.PolygonReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) { goog.asserts.assert(this.state_, 'this.state_ should not be null'); goog.asserts.assert(fillStyle, 'fillStyle should not be null'); - var fillStyleColor = ol.color.asArray(fillStyle.getColor()); - if (Array.isArray(fillStyleColor)) { - fillStyleColor = fillStyleColor.map(function(c, i) { + var fillStyleColor = fillStyle.getColor(); + if (!(fillStyleColor instanceof CanvasGradient) && + !(fillStyleColor instanceof CanvasPattern)) { + fillStyleColor = ol.color.asArray(fillStyleColor).map(function(c, i) { return i != 3 ? c / 255 : c; }) || ol.render.webgl.defaultFillStyle; } else {