Debian Codegraph @

dojox/gfx/tests/svgweb/test_arc.html

raw symbols SCIP
1 <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
2 <head>
3 <title>Testing arc</title>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <style type="text/css">
6 @import "../../../../dojo/resources/dojo.css";
7 @import "../../../../dijit/tests/css/dijitTests.css";
8 </style>
9 <!-- SVGWEB { -->
10 <meta name="svg.render.forceflash" content="true"/>
11 <script src="svgweb/src/svg.js" data-path="svgweb/src"></script>
12 <script src="../../../../dojo/dojo.js" data-dojo-config="isDebug:true,forceGfxRenderer:'svg'" type="text/javascript"></script>
13 <!-- } -->
14 <script type="text/javascript">
15 dojo.require("dojox.gfx");
16
17 createSurface = function(){
18 var surface = dojox.gfx.createSurface("test", 500, 500);
19 surface.whenLoaded(makeShapes);
20 };
21
22 makeShapes = function(surface){
23 var m = dojox.gfx.matrix;
24 var g1 = surface.createGroup();
25 var g2 = g1.createGroup();
26
27 var rx = 100, ry = 60, xRotg = -30;
28 var startPoint = m.multiplyPoint(m.rotateg(xRotg), {x: -rx, y: 0 });
29 var endPoint = m.multiplyPoint(m.rotateg(xRotg), {x: 0, y: -ry});
30
31 var re1 = g1.createPath()
32 .moveTo(startPoint)
33 .arcTo(rx, ry, xRotg, true, false, endPoint)
34 .setStroke({color: "red", width: 3})
35 ;
36 var ge1 = g1.createPath()
37 .moveTo(re1.getLastPosition())
38 .arcTo(rx, ry, xRotg, false, false, startPoint)
39 .setStroke({color: "black"})
40 ;
41 var re2 = g2.createPath()
42 .moveTo(startPoint)
43 .arcTo(rx, ry, xRotg, false, true, endPoint)
44 .setStroke({color: "green", width: 3})
45 ;
46 var ge2 = g2.createPath()
47 .moveTo(re2.getLastPosition())
48 .arcTo(rx, ry, xRotg, true, true, startPoint)
49 .setStroke({color: "black"})
50 ;
51
52 g1.setTransform({dx: 200, dy: 200});
53 g2.setTransform({dx: 10, dy: 10});
54 };
55
56 dojo.addOnLoad(createSurface);
57
58 </script>
59 </head>
60 <body>
61 <h1>Testing arc</h1>
62 <!--<p><button onclick="createSurface();">Go</button></p>-->
63 <div id="test" style="width: 500px; height: 500px;"></div>
64 <p>That's all Folks!</p>
65 </body>
66 </html>