Allow ol.style.Stroke#width to be undefined
This commit is contained in:
@@ -278,7 +278,7 @@ ol.render.canvas.Immediate.prototype.setFillStrokeStyle =
|
||||
if (!ol.style.stroke.equals(state.strokeStyle, strokeStyle)) {
|
||||
if (goog.isDefAndNotNull(strokeStyle)) {
|
||||
context.strokeStyle = ol.color.asString(strokeStyle.color);
|
||||
context.lineWidth = strokeStyle.width;
|
||||
context.lineWidth = goog.isDef(strokeStyle.width) ? strokeStyle.width : 1;
|
||||
}
|
||||
state.strokeStyle = strokeStyle;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ ol.render.canvas.Replay.prototype.draw = function(context, transform) {
|
||||
goog.asserts.assert(goog.isObject(instruction[1]));
|
||||
var strokeStyle = /** @type {ol.style.Stroke} */ (instruction[1]);
|
||||
context.strokeStyle = ol.color.asString(strokeStyle.color);
|
||||
context.lineWidth = strokeStyle.width;
|
||||
context.lineWidth = goog.isDef(strokeStyle.width) ? strokeStyle.width : 1;
|
||||
++i;
|
||||
} else if (type == ol.render.canvas.Instruction.STROKE) {
|
||||
context.stroke();
|
||||
|
||||
@@ -37,7 +37,7 @@ ol.shape.renderCircle = function(radius, fillStyle, strokeStyle) {
|
||||
}
|
||||
if (goog.isDefAndNotNull(strokeStyle)) {
|
||||
context.strokeStyle = ol.color.asString(strokeStyle.color);
|
||||
context.lineWidth = strokeStyle.width;
|
||||
context.lineWidth = goog.isDef(strokeStyle.width) ? strokeStyle.width : 1;
|
||||
context.stroke();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user