Я хочу иметь фигуры, которые пересекаются друг с другом.
Пересечение должно быть пустым. Где-то я читал, что это достигается путем рисования по часовой стрелке и против часовой стрелки. Но я не могу понять это ...
это мой код:
<html>
<head>
<script>
with( document.getElementById( 'myCanvas' ).getContext( '2d' ) ){
shadowOffsetX = 10;
shadowOffsetY = 10;
shadowBlur = 20;
shadowColor = "rgba(0, 0, 0, .75)";
translate( 50, 70 );
scale( 2, 2 );
beginPath();
fillStyle = 'red';
strokeStyle = "white";
fillStyle = "#FFFF00";
beginPath();
arc(100,100,50,Math.PI*2,0,true);
closePath();
stroke();
fill();
strokeStyle = "white";
fillStyle = "#FFFF00";
beginPath();
arc(50,50,50,-Math.PI*2,0,true);
closePath();
stroke();
fill();
closePath();
fill();
}
</script>
</head>
<body>
<canvas
id = myCanvas
width = 400
height = 400
style = "border:1px solid #000"
>
</canvas>
</body>
Что я получаю, это:
http://dl.dropbox.com/u/1144075/Bild%207.png