implements setLineDash

implements canvas.setLineDash
This commit is contained in:
Fu Zhen 2015-11-27 03:34:03 +08:00
parent 1e101b54a9
commit 9ee9cc2e6c

View File

@ -167,6 +167,12 @@
}, },
"textBaseline":{ "textBaseline":{
canvas : "alphabetic" canvas : "alphabetic"
},
"lineDash" : {
svgAttr : "stroke-dasharray",
canvas : [],
svg : null,
apply : "stroke"
} }
}; };
@ -1103,6 +1109,14 @@
return new CanvasPattern(pattern, this); return new CanvasPattern(pattern, this);
}; };
ctx.prototype.setLineDash = function(dashArray) {
if (dashArray && dashArray.length > 0) {
this.lineDash = dashArray.join(",");
} else {
this.lineDash = null;
}
};
/** /**
* Not yet implemented * Not yet implemented
*/ */
@ -1112,7 +1126,6 @@
ctx.prototype.putImageData = function(){}; ctx.prototype.putImageData = function(){};
ctx.prototype.globalCompositeOperation = function(){}; ctx.prototype.globalCompositeOperation = function(){};
ctx.prototype.setTransform = function(){}; ctx.prototype.setTransform = function(){};
ctx.prototype.setLineDash = function(){};
//add options for alternative namespace //add options for alternative namespace
if (typeof window === "object") { if (typeof window === "object") {