Allow ol.style.Stroke#width to be undefined

This commit is contained in:
Tom Payne
2013-11-14 00:05:18 +01:00
parent 6796b9735e
commit d60bc61a72
3 changed files with 3 additions and 3 deletions

View File

@@ -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();