]>
git.proxmox.com Git - sencha-touch.git/blob - src/examples/kitchensink/app/view/XRay.js
2 Ext
.define('Kitchensink.view.XRay', {
4 extend
: 'Ext.draw.sprite.Path',
5 render: function (surface
, ctx
) {
8 imat
= attr
.inverseMatrix
,
10 size
= imat
.x(2, 0) - imat
.x(0, 0);
11 if (attr
.path
.coords
.length
=== 0) {
18 ln
= path
.types
.length
;
24 ctx
.moveTo(coords
[j
], coords
[j
+ 1]);
28 ctx
.lineTo(coords
[j
], coords
[j
+ 1]);
33 coords
[j
], coords
[j
+ 1],
34 coords
[j
+ 2], coords
[j
+ 3],
35 coords
[j
+ 4], coords
[j
+ 5]
49 for (i
= 0, j
= 0; i
< ln
; i
++) {
52 ctx
.moveTo(coords
[j
] - size
, coords
[j
+ 1] - size
);
53 ctx
.rect(coords
[j
] - size
, coords
[j
+ 1] - size
, size
* 2, size
* 2);
57 ctx
.moveTo(coords
[j
] - size
, coords
[j
+ 1] - size
);
58 ctx
.rect(coords
[j
] - size
, coords
[j
+ 1] - size
, size
* 2, size
* 2);
62 ctx
.moveTo(coords
[j
] + size
, coords
[j
+ 1]);
63 ctx
.arc(coords
[j
], coords
[j
+ 1], size
, 0, Math
.PI
* 2, true);
65 ctx
.moveTo(coords
[j
] + size
, coords
[j
+ 1]);
66 ctx
.arc(coords
[j
], coords
[j
+ 1], size
, 0, Math
.PI
* 2, true);
68 ctx
.moveTo(coords
[j
] + size
* 2, coords
[j
+ 1]);
69 ctx
.rect(coords
[j
] - size
, coords
[j
+ 1] - size
, size
* 2, size
* 2);
76 ctx
.strokeStyle
= "black";
77 ctx
.strokeOpacity
= 1;
83 for (i
= 0, j
= 0; i
< ln
; i
++) {
86 ctx
.moveTo(coords
[j
], coords
[j
+ 1]);
90 ctx
.moveTo(coords
[j
], coords
[j
+ 1]);
94 ctx
.lineTo(coords
[j
], coords
[j
+ 1]);
96 ctx
.moveTo(coords
[j
], coords
[j
+ 1]);
98 ctx
.lineTo(coords
[j
], coords
[j
+ 1]);
105 ctx
.lineWidth
= 1 / 2;