| Index: LayoutTests/fast/canvas/canvas-ellipse-circumference-expected.html
|
| diff --git a/LayoutTests/fast/canvas/canvas-ellipse-circumference-expected.html b/LayoutTests/fast/canvas/canvas-ellipse-circumference-expected.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8d928874a399557427bb4add60c57e1a4a9c503a
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/canvas/canvas-ellipse-circumference-expected.html
|
| @@ -0,0 +1,101 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head></head>
|
| +<body>
|
| +<canvas id="mycanvas" width="400" height="200"></canvas>
|
| +<script src="script-tests/js-ellipse-implementation.js"></script>
|
| +<script>
|
| +//This tests checks that ellipse can draw correct circumferences with lineTo.
|
| +var canvas = document.getElementById('mycanvas');
|
| +var ctx = canvas.getContext('2d');
|
| +
|
| +ctx.lineWidth = 7;
|
| +ctx.fillStyle = 'rgb(255, 255, 255)';
|
| +ctx.strokeStyle = 'rgb(0, 0, 0)';
|
| +ctx.fillRect(0, 0, canvas.width, canvas.height);
|
| +
|
| +// Check clockwise circumference.
|
| +// 1. sweepAngle == 2PI
|
| +ctx.save();
|
| +ctx.beginPath();
|
| +ctx.moveTo(0, 10);
|
| +ellipseUsingArc(ctx, 60, 50, 30, 20, Math.PI / 6, -Math.PI, Math.PI, false);
|
| +ctx.lineTo(0, 90);
|
| +ctx.stroke();
|
| +ctx.restore();
|
| +
|
| +// 2. sweepAngle == PI
|
| +ctx.translate(100, 0);
|
| +ctx.save();
|
| +ctx.beginPath();
|
| +ctx.moveTo(0, 10);
|
| +ellipseUsingArc(ctx, 60, 50, 30, 20, Math.PI / 6, -Math.PI, 0, false);
|
| +ctx.lineTo(0, 90);
|
| +ctx.stroke();
|
| +ctx.restore();
|
| +
|
| +// 3. sweepAngle > 2PI
|
| +ctx.translate(100, 0);
|
| +ctx.save();
|
| +ctx.beginPath();
|
| +ctx.moveTo(0, 10);
|
| +ellipseUsingArc(ctx, 60, 50, 30, 20, Math.PI / 6, -Math.PI, Math.PI * 2.5, false);
|
| +ctx.lineTo(0, 90);
|
| +ctx.stroke();
|
| +ctx.restore();
|
| +
|
| +// 4. sweepAngle < 0
|
| +ctx.translate(100, 0);
|
| +ctx.save();
|
| +ctx.beginPath();
|
| +ctx.moveTo(0, 10);
|
| +ellipseUsingArc(ctx, 60, 50, 30, 20, Math.PI / 6, Math.PI * 1.5, -Math.PI, false);
|
| +ctx.lineTo(0, 90);
|
| +ctx.stroke();
|
| +ctx.restore();
|
| +
|
| +// Check anticlockwise circumference.
|
| +// 1. sweepAngle == 2PI
|
| +ctx.translate(-300, 100);
|
| +ctx.save();
|
| +ctx.beginPath();
|
| +ctx.moveTo(0, 10);
|
| +ellipseUsingArc(ctx, 60, 50, 30, 20, Math.PI / 6, Math.PI, -Math.PI, true);
|
| +ctx.lineTo(0, 90);
|
| +ctx.stroke();
|
| +ctx.restore();
|
| +
|
| +// 2. sweepAngle == PI
|
| +ctx.translate(100, 0);
|
| +ctx.save();
|
| +ctx.beginPath();
|
| +ctx.moveTo(0, 10);
|
| +ellipseUsingArc(ctx, 60, 50, 30, 20, Math.PI / 6, Math.PI, 0, true);
|
| +ctx.lineTo(0, 90);
|
| +ctx.stroke();
|
| +ctx.restore();
|
| +
|
| +// 3. sweepAngle > 2PI
|
| +ctx.translate(100, 0);
|
| +ctx.save();
|
| +ctx.beginPath();
|
| +ctx.moveTo(0, 10);
|
| +ellipseUsingArc(ctx, 60, 50, 30, 20, Math.PI / 6, Math.PI, Math.PI * -1.5, true);
|
| +ctx.lineTo(0, 90);
|
| +ctx.stroke();
|
| +ctx.restore();
|
| +
|
| +// 4. sweepAngle < 0
|
| +ctx.translate(100, 0);
|
| +ctx.save();
|
| +ctx.beginPath();
|
| +ctx.moveTo(0, 10);
|
| +ellipseUsingArc(ctx, 60, 50, 30, 20, Math.PI / 6, Math.PI * -1.5, Math.PI, true);
|
| +ctx.lineTo(0, 90);
|
| +ctx.stroke();
|
| +ctx.restore();
|
| +
|
| +</script>
|
| +</body>
|
| +</html>
|
| +
|
|
|