]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * @class Ext.draw.sprite.EllipticalArc\r | |
3 | * @extends Ext.draw.sprite.Ellipse\r | |
4 | *\r | |
5 | * A sprite that represents an elliptical arc.\r | |
6 | *\r | |
7 | * @example\r | |
8 | * Ext.create({\r | |
9 | * xtype: 'draw', \r | |
10 | * renderTo: document.body,\r | |
11 | * width: 600,\r | |
12 | * height: 400,\r | |
13 | * sprites: [{\r | |
14 | * type: 'ellipticalArc',\r | |
15 | * cx: 100,\r | |
16 | * cy: 100,\r | |
17 | * rx: 80,\r | |
18 | * ry: 50,\r | |
19 | * fillStyle: '#1F6D91',\r | |
20 | * startAngle: 0,\r | |
21 | * endAngle: Math.PI,\r | |
22 | * anticlockwise: true\r | |
23 | * }]\r | |
24 | * });\r | |
25 | */\r | |
26 | Ext.define('Ext.draw.sprite.EllipticalArc', {\r | |
27 | extend: 'Ext.draw.sprite.Ellipse',\r | |
28 | alias: 'sprite.ellipticalArc',\r | |
29 | type: 'ellipticalArc',\r | |
30 | inheritableStatics: {\r | |
31 | def: {\r | |
32 | processors: {\r | |
33 | /**\r | |
34 | * @cfg {Number} [startAngle=0] The beginning angle of the arc.\r | |
35 | */\r | |
36 | startAngle: 'number',\r | |
37 | \r | |
38 | /**\r | |
39 | * @cfg {Number} [endAngle=Math.PI*2] The ending angle of the arc.\r | |
40 | */\r | |
41 | endAngle: 'number',\r | |
42 | \r | |
43 | /**\r | |
44 | * @cfg {Boolean} [anticlockwise=false] Determines whether or not the arc is drawn clockwise.\r | |
45 | */\r | |
46 | anticlockwise: 'bool'\r | |
47 | },\r | |
48 | aliases: {\r | |
49 | from: 'startAngle',\r | |
50 | to: 'endAngle',\r | |
51 | start: 'startAngle',\r | |
52 | end: 'endAngle'\r | |
53 | },\r | |
54 | defaults: {\r | |
55 | startAngle: 0,\r | |
56 | endAngle: Math.PI * 2,\r | |
57 | anticlockwise: false\r | |
58 | },\r | |
59 | triggers: {\r | |
60 | startAngle: 'path',\r | |
61 | endAngle: 'path',\r | |
62 | anticlockwise: 'path'\r | |
63 | }\r | |
64 | }\r | |
65 | },\r | |
66 | \r | |
67 | updatePath: function (path, attr) {\r | |
68 | path.ellipse(attr.cx, attr.cy, attr.rx, attr.ry, attr.axisRotation, attr.startAngle, attr.endAngle, attr.anticlockwise);\r | |
69 | }\r | |
70 | }); |