]> git.proxmox.com Git - sencha-touch.git/blob - src/src/draw/sprite/Line.js
import Sencha Touch 2.4.2 source
[sencha-touch.git] / src / src / draw / sprite / Line.js
1 Ext.define('Ext.draw.sprite.Line', {
2 extend: 'Ext.draw.sprite.Sprite',
3 alias: 'sprite.line',
4 type: 'line',
5
6 inheritableStatics: {
7 def: {
8 processors: {
9 fromX: 'number',
10 fromY: 'number',
11 toX: 'number',
12 toY: 'number'
13 },
14
15 defaults: {
16 fromX: 0,
17 fromY: 0,
18 toX: 1,
19 toY: 1
20 }
21 }
22 },
23
24 render: function (surface, ctx, clipRegion) {
25 var attr = this.attr,
26 matrix = this.attr.matrix;
27
28 matrix.toContext(ctx);
29
30 ctx.beginPath();
31 ctx.moveTo(attr.fromX, attr.fromY);
32 ctx.lineTo(attr.toX, attr.toY);
33 ctx.stroke();
34 }
35 });