Thursday, May 19, 2011

lineJoin

The lineJoin attribute defines the type of corners where two lines meet. The three valid values are bevel, round, and miter.

example:
function drawLineJoin(context){

context.strokeStyle = "#000000";
context.lineWidth = 20;

context.lineJoin = "bevel";
context.beginPath();
context.moveTo(50, 50);
context.lineTo(300, 50);
context.lineTo(300, 100);
context.stroke();
context.closePath();

context.lineJoin = "round";
context.beginPath();
context.moveTo(50, 150);
context.lineTo(300, 150);
context.lineTo(300, 200);
context.stroke();
context.closePath();

context.lineJoin = "miter";
context.beginPath();
context.moveTo(50, 250);
context.lineTo(300, 250);
context.lineTo(300, 300);
context.stroke();
context.closePath();
}



lineJoin

No comments:

Post a Comment