Add getters to ol.style.Fill

This commit is contained in:
Éric Lemoine
2013-12-19 11:41:38 +01:00
parent 8fdd178d0a
commit 16047ff852
4 changed files with 17 additions and 6 deletions

View File

@@ -378,8 +378,9 @@ ol.render.canvas.Immediate.prototype.setFillStrokeStyle =
function(fillStyle, strokeStyle) {
var state = this.state_;
if (!goog.isNull(fillStyle)) {
state.fillStyle = ol.color.asString(!goog.isNull(fillStyle.color) ?
fillStyle.color : ol.render.canvas.defaultFillStyle);
var fillStyleColor = fillStyle.getColor();
state.fillStyle = ol.color.asString(!goog.isNull(fillStyleColor) ?
fillStyleColor : ol.render.canvas.defaultFillStyle);
} else {
state.fillStyle = undefined;
}

View File

@@ -1027,8 +1027,9 @@ ol.render.canvas.PolygonReplay.prototype.setFillStrokeStyle =
goog.asserts.assert(!goog.isNull(fillStyle) || !goog.isNull(strokeStyle));
var state = this.state_;
if (!goog.isNull(fillStyle)) {
state.fillStyle = ol.color.asString(!goog.isNull(fillStyle.color) ?
fillStyle.color : ol.render.canvas.defaultFillStyle);
var fillStyleColor = fillStyle.getColor();
state.fillStyle = ol.color.asString(!goog.isNull(fillStyleColor) ?
fillStyleColor : ol.render.canvas.defaultFillStyle);
} else {
state.fillStyle = undefined;
}