]> git.proxmox.com Git - sencha-touch.git/blob - src/src/fx/easing/Linear.js
import Sencha Touch 2.4.2 source
[sencha-touch.git] / src / src / fx / easing / Linear.js
1 /**
2 * @private
3 */
4 Ext.define('Ext.fx.easing.Linear', {
5
6 extend: 'Ext.fx.easing.Abstract',
7
8 alias: 'easing.linear',
9
10 config: {
11 duration: 0,
12 endValue: 0
13 },
14
15 updateStartValue: function(startValue) {
16 this.distance = this.getEndValue() - startValue;
17 },
18
19 updateEndValue: function(endValue) {
20 this.distance = endValue - this.getStartValue();
21 },
22
23 getValue: function() {
24 var deltaTime = Ext.Date.now() - this.getStartTime(),
25 duration = this.getDuration();
26
27 if (deltaTime > duration) {
28 this.isEnded = true;
29 return this.getEndValue();
30 }
31 else {
32 return this.getStartValue() + ((deltaTime / duration) * this.distance);
33 }
34 }
35 });