From c29f752612f5f6f26045cb4b1a0bcca1f30eeddb Mon Sep 17 00:00:00 2001 From: fuzhen Date: Fri, 27 Nov 2015 12:58:41 +0800 Subject: [PATCH] add example of setLineDash --- test/example/setLineDash.js | 12 ++++++++++++ test/playground.html | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 test/example/setLineDash.js diff --git a/test/example/setLineDash.js b/test/example/setLineDash.js new file mode 100644 index 0000000..7b09cdc --- /dev/null +++ b/test/example/setLineDash.js @@ -0,0 +1,12 @@ +window.C2S_EXAMPLES['setLineDash'] = function(ctx) { + ctx.save(); + ctx.lineWidth = 4; + for (var i = 0; i < 10; i++){ + ctx.setLineDash([(i+1)*5,10]); + ctx.beginPath(); + ctx.moveTo(5+i*14,5); + ctx.lineTo(5+i*14,140); + ctx.stroke(); + } + ctx.restore(); +}; \ No newline at end of file diff --git a/test/playground.html b/test/playground.html index ab1cad2..67cf143 100644 --- a/test/playground.html +++ b/test/playground.html @@ -20,7 +20,7 @@
- +
@@ -64,7 +64,7 @@ -
+