Use the default fill and stroke color

This commit is contained in:
Frederic Junod
2017-03-02 17:14:31 +01:00
parent 49af45c8b7
commit 1d3eb2eb6e
4 changed files with 107 additions and 77 deletions

View File

@@ -322,7 +322,11 @@ ol.style.RegularShape.prototype.render_ = function(atlasManager) {
var strokeWidth = 0;
if (this.stroke_) {
strokeStyle = ol.colorlike.asColorLike(this.stroke_.getColor());
strokeStyle = this.stroke_.getColor();
if (strokeStyle === null) {
strokeStyle = ol.render.canvas.defaultStrokeStyle;
}
strokeStyle = ol.colorlike.asColorLike(strokeStyle);
strokeWidth = this.stroke_.getWidth();
if (strokeWidth === undefined) {
strokeWidth = ol.render.canvas.defaultLineWidth;
@@ -442,7 +446,11 @@ ol.style.RegularShape.prototype.draw_ = function(renderOptions, context, x, y) {
if (this.fill_) {
context.fillStyle = ol.colorlike.asColorLike(this.fill_.getColor());
var color = this.fill_.getColor();
if (color === null) {
color = ol.render.canvas.defaultFillStyle;
}
context.fillStyle = ol.colorlike.asColorLike(color);
context.fill();
}
if (this.stroke_) {