comparison geotemco/lib/excanvas/testcases/saverestorepath.html @ 0:b12c99b7c3f0

commit for previous development
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 19 Jan 2015 17:13:49 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:b12c99b7c3f0
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Save/restore path Test</title>
5 <style>
6
7 body {
8 text-align: center
9 }
10
11 </style>
12 <!--[if IE]><script type="text/javascript" src="../excanvas.js"></script><![endif]-->
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.save();
24 ctx.lineTo(100, 50);
25 ctx.restore();
26
27 ctx.save();
28 ctx.lineTo(50, 0);
29 ctx.restore();
30
31 ctx.save();
32 ctx.lineTo(0, 50);
33 ctx.restore();
34
35 ctx.stroke();
36 };
37
38 </script>
39 </head>
40 <body>
41
42 <canvas id=c width=200 height=200></canvas>
43
44 <p>This tests ensures that save/restore does not do anything to the current
45 path. You should see a diamond shape above.</p>
46
47 </body>
48 </html>