diff options
author | Jose Antonio Marquez | 2012-04-24 10:06:53 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-04-24 10:06:53 -0700 |
commit | 4c15e77bdb7f4e0558f3749994a8a37b207b97ae (patch) | |
tree | 593ab4917fb5cc3ef8ee36822b56c6edd30c33a5 /node_modules/montage/ui/flow-path-lerp.js | |
parent | 36d50b6599ab98559c76e1fe57b1bb131c4433da (diff) | |
parent | 55e6d621b9555abac06ab4adff44dfe29a78ec4e (diff) | |
download | ninja-4c15e77bdb7f4e0558f3749994a8a37b207b97ae.tar.gz |
Merge branch 'refs/heads/Ninja-Internal' into Document
Diffstat (limited to 'node_modules/montage/ui/flow-path-lerp.js')
-rw-r--r-- | node_modules/montage/ui/flow-path-lerp.js | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/node_modules/montage/ui/flow-path-lerp.js b/node_modules/montage/ui/flow-path-lerp.js deleted file mode 100644 index bc550500..00000000 --- a/node_modules/montage/ui/flow-path-lerp.js +++ /dev/null | |||
@@ -1,112 +0,0 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | var Montage = require("montage").Montage; | ||
8 | |||
9 | var FlowPathLerp = exports.FlowPathLerp = Montage.create(Montage, { | ||
10 | |||
11 | _path1: { | ||
12 | enumerable: false, | ||
13 | value: null | ||
14 | }, | ||
15 | |||
16 | _path2: { | ||
17 | enumerable: false, | ||
18 | value: null | ||
19 | }, | ||
20 | |||
21 | _interpolant: { | ||
22 | enumerable: false, | ||
23 | value: 0 | ||
24 | }, | ||
25 | |||
26 | path1: { | ||
27 | get: function () { | ||
28 | return this._path1; | ||
29 | }, | ||
30 | set: function (value) { | ||
31 | this._path1 = value; | ||
32 | this.resultPath = true; | ||
33 | } | ||
34 | }, | ||
35 | |||
36 | path2: { | ||
37 | get: function () { | ||
38 | return this._path2; | ||
39 | }, | ||
40 | set: function (value) { | ||
41 | this._path2 = value; | ||
42 | this.resultPath = true; | ||
43 | } | ||
44 | }, | ||
45 | |||
46 | interpolant: { | ||
47 | get: function () { | ||
48 | return this._interpolant; | ||
49 | }, | ||
50 | set: function (value) { | ||
51 | this._interpolant = value; | ||
52 | this.resultPath = true; | ||
53 | } | ||
54 | }, | ||
55 | |||
56 | _resultPath: { | ||
57 | enumerable: false, | ||
58 | value: null | ||
59 | }, | ||
60 | |||
61 | resultPath: { | ||
62 | get: function () { | ||
63 | return this._resultPath; | ||
64 | }, | ||
65 | set: function () { | ||
66 | var self = this; | ||
67 | |||
68 | this._resultPath = { | ||
69 | value: function (slide) { | ||
70 | var v1=self._path1.value(slide), | ||
71 | v2=self._path2.value(slide), | ||
72 | m1=1-self._interpolant, | ||
73 | m2=self._interpolant, | ||
74 | result={}, | ||
75 | i; | ||
76 | |||
77 | for (i in v1) { | ||
78 | if (v1.hasOwnProperty(i)&&(i!="style")) { | ||
79 | if (v2.hasOwnProperty(i)) { | ||
80 | if ((typeof v1[i]==="number")&&(typeof v2[i]==="number")) { | ||
81 | result[i]=v1[i]*m1+v2[i]*m2; | ||
82 | } else { | ||
83 | result[i]=v1[i]; | ||
84 | } | ||
85 | } else { | ||
86 | result[i]=v1[i]; | ||
87 | } | ||
88 | } | ||
89 | } | ||
90 | for (i in v2) { | ||
91 | if (v2.hasOwnProperty(i)&&(i!="style")&&(!v1.hasOwnProperty(i))) { | ||
92 | result[i]=v2[i]; | ||
93 | } | ||
94 | } | ||
95 | if (v1.style) { | ||
96 | result.style={}; | ||
97 | for (i in v1.style) { | ||
98 | if (v1.style.hasOwnProperty(i)) { | ||
99 | if ((v2.style)&&(v2.style.hasOwnProperty(i))&&(typeof v1.style[i]==="number")&&(typeof v2.style[i]==="number")) { | ||
100 | result.style[i]=v1.style[i]*m1+v2.style[i]*m2; | ||
101 | } else { | ||
102 | result.style[i]=v1.style[i]; | ||
103 | } | ||
104 | } | ||
105 | } | ||
106 | } | ||
107 | return result; | ||
108 | } | ||
109 | }; | ||
110 | } | ||
111 | } | ||
112 | }); | ||