Sanity check fill colors.
This commit is contained in:
@@ -1936,9 +1936,10 @@ ol.render.webgl.PolygonReplay.prototype.setFillStyle_ = function(gl, color) {
|
|||||||
ol.render.webgl.PolygonReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
|
ol.render.webgl.PolygonReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
|
||||||
goog.asserts.assert(this.state_, 'this.state_ should not be null');
|
goog.asserts.assert(this.state_, 'this.state_ should not be null');
|
||||||
goog.asserts.assert(fillStyle, 'fillStyle should not be null');
|
goog.asserts.assert(fillStyle, 'fillStyle should not be null');
|
||||||
var fillStyleColor = ol.color.asArray(fillStyle.getColor());
|
var fillStyleColor = fillStyle.getColor();
|
||||||
if (Array.isArray(fillStyleColor)) {
|
if (!(fillStyleColor instanceof CanvasGradient) &&
|
||||||
fillStyleColor = fillStyleColor.map(function(c, i) {
|
!(fillStyleColor instanceof CanvasPattern)) {
|
||||||
|
fillStyleColor = ol.color.asArray(fillStyleColor).map(function(c, i) {
|
||||||
return i != 3 ? c / 255 : c;
|
return i != 3 ? c / 255 : c;
|
||||||
}) || ol.render.webgl.defaultFillStyle;
|
}) || ol.render.webgl.defaultFillStyle;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user