| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<title>Clear path Test</title> |
| 5 |
<style> |
| 6 |
|
| 7 |
body { |
| 8 |
text-align: center |
| 9 |
} |
| 10 |
|
| 11 |
</style> |
| 12 |
|
| 13 |
<script> |
| 14 |
|
| 15 |
window.onload = function() { |
| 16 |
var ctx = document.getElementById('c').getContext('2d'); |
| 17 |
|
| 18 |
// Need to test clearRect, strokeRect, fillRect |
| 19 |
ctx.beginPath(); |
| 20 |
ctx.moveTo(0, 50); |
| 21 |
ctx.lineTo(50, 100); |
| 22 |
|
| 23 |
ctx.strokeRect(100.5, 125.5, 49, 49); |
| 24 |
|
| 25 |
ctx.lineTo(100, 50); |
| 26 |
|
| 27 |
ctx.fillRect(50, 125, 50, 50); |
| 28 |
|
| 29 |
ctx.lineTo(50, 0); |
| 30 |
|
| 31 |
// clearRect is not correctly implmented in ExCanvas but for this test its |
| 32 |
// current behavior is enough. |
| 33 |
ctx.clearRect(50, 125, 100, 50); |
| 34 |
|
| 35 |
ctx.lineTo(0, 50); |
| 36 |
ctx.stroke(); |
| 37 |
}; |
| 38 |
|
| 39 |
</script> |
| 40 |
</head> |
| 41 |
<body> |
| 42 |
|
| 43 |
<canvas id=c width=200 height=200></canvas> |
| 44 |
|
| 45 |
<p>This tests the clearing of the path. You should only see a diamond shape |
| 46 |
above.</p> |
| 47 |
|
| 48 |
</body> |
| 49 |
</html> |