blob: a6e06f605690f0661cb8a3d7f01e7b27f27984ae [file] [log] [blame]
<canvas id="mycanvas" width="150" height="100"></canvas>
<script type = 'text/javascript'>
var canvas = document.getElementById('mycanvas');
var ctx = canvas.getContext('2d');
ctx.lineWidth = 20;
// Checking whether straight lines with empty length have proper line caps
ctx.lineCap = 'round';
ctx.beginPath();
ctx.moveTo(50, 50);
ctx.lineTo(50, 50);
ctx.stroke();
ctx.lineCap = 'square';
ctx.beginPath();
ctx.moveTo(100, 50);
ctx.lineTo(100, 50);
ctx.stroke();
</script>