source:
trunk/examples/script/context2d/scripts/linecap.js
Last change on this file was 2, checked in by , 16 years ago | |
---|---|
File size: 541 bytes |
Line | |
---|---|
1 | var ctx = document.getElementById('tutorial').getContext('2d'); |
2 | var lineCap = ['butt','round','square']; |
3 | |
4 | // Draw guides |
5 | ctx.save(); |
6 | ctx.strokeStyle = '#09f'; |
7 | ctx.beginPath(); |
8 | ctx.moveTo(10,10); |
9 | ctx.lineTo(140,10); |
10 | ctx.moveTo(10,140); |
11 | ctx.lineTo(140,140); |
12 | ctx.stroke(); |
13 | |
14 | // Draw lines |
15 | ctx.strokeStyle = 'black'; |
16 | for (i=0;i<lineCap.length;i++){ |
17 | ctx.lineWidth = 15; |