OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2013 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 <link rel="import" href="/tracing/base/utils.html"> | 7 <link rel="import" href="/tracing/base/utils.html"> |
8 <link rel="import" href="/tracing/ui/base/animation.html"> | 8 <link rel="import" href="/tracing/ui/base/animation.html"> |
9 | 9 |
10 <script> | 10 <script> |
11 'use strict'; | 11 'use strict'; |
12 | 12 |
13 tr.exportTo('tr.ui', function() { | 13 tr.exportTo('tr.ui', function() { |
14 var kDefaultPanAnimatoinDurationMs = 100.0; | 14 var kDefaultPanAnimationDurationMs = 100.0; |
15 | 15 |
16 /** | 16 /** |
17 * Pans a TimelineDisplayTransform by a given amount. | 17 * Pans a TimelineDisplayTransform by a given amount. |
18 * @constructor | 18 * @constructor |
19 * @extends {tr.ui.b.Animation} | 19 * @extends {tr.ui.b.Animation} |
20 * @param {Number} deltaX The total amount of change to the transform's panX. | 20 * @param {Number} deltaX The total amount of change to the transform's panX. |
21 * @param {Number} deltaY The total amount of change to the transform's panY. | 21 * @param {Number} deltaY The total amount of change to the transform's panY. |
22 * @param {Number=} opt_durationMs How long the pan animation should run. | 22 * @param {Number=} opt_durationMs How long the pan animation should run. |
23 * Defaults to kDefaultPanAnimatoinDurationMs. | 23 * Defaults to kDefaultPanAnimationDurationMs. |
24 */ | 24 */ |
25 function TimelineDisplayTransformPanAnimation( | 25 function TimelineDisplayTransformPanAnimation( |
26 deltaX, deltaY, opt_durationMs) { | 26 deltaX, deltaY, opt_durationMs) { |
27 this.deltaX = deltaX; | 27 this.deltaX = deltaX; |
28 this.deltaY = deltaY; | 28 this.deltaY = deltaY; |
29 if (opt_durationMs === undefined) | 29 if (opt_durationMs === undefined) |
30 this.durationMs = kDefaultPanAnimatoinDurationMs; | 30 this.durationMs = kDefaultPanAnimationDurationMs; |
31 else | 31 else |
32 this.durationMs = opt_durationMs; | 32 this.durationMs = opt_durationMs; |
33 | 33 |
34 this.startPanX = undefined; | 34 this.startPanX = undefined; |
35 this.startPanY = undefined; | 35 this.startPanY = undefined; |
36 this.startTimeMs = undefined; | 36 this.startTimeMs = undefined; |
37 } | 37 } |
38 | 38 |
39 TimelineDisplayTransformPanAnimation.prototype = { | 39 TimelineDisplayTransformPanAnimation.prototype = { |
40 __proto__: tr.ui.b.Animation.prototype, | 40 __proto__: tr.ui.b.Animation.prototype, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 goalFocalPointXWorld, | 109 goalFocalPointXWorld, |
110 goalFocalPointXView, | 110 goalFocalPointXView, |
111 goalFocalPointY, | 111 goalFocalPointY, |
112 zoomInRatioX, | 112 zoomInRatioX, |
113 opt_durationMs) { | 113 opt_durationMs) { |
114 this.goalFocalPointXWorld = goalFocalPointXWorld; | 114 this.goalFocalPointXWorld = goalFocalPointXWorld; |
115 this.goalFocalPointXView = goalFocalPointXView; | 115 this.goalFocalPointXView = goalFocalPointXView; |
116 this.goalFocalPointY = goalFocalPointY; | 116 this.goalFocalPointY = goalFocalPointY; |
117 this.zoomInRatioX = zoomInRatioX; | 117 this.zoomInRatioX = zoomInRatioX; |
118 if (opt_durationMs === undefined) | 118 if (opt_durationMs === undefined) |
119 this.durationMs = kDefaultPanAnimatoinDurationMs; | 119 this.durationMs = kDefaultPanAnimationDurationMs; |
120 else | 120 else |
121 this.durationMs = opt_durationMs; | 121 this.durationMs = opt_durationMs; |
122 | 122 |
123 this.startTimeMs = undefined; | 123 this.startTimeMs = undefined; |
124 this.startScaleX = undefined; | 124 this.startScaleX = undefined; |
125 this.goalScaleX = undefined; | 125 this.goalScaleX = undefined; |
126 this.startPanY = undefined; | 126 this.startPanY = undefined; |
127 } | 127 } |
128 | 128 |
129 TimelineDisplayTransformZoomToAnimation.prototype = { | 129 TimelineDisplayTransformZoomToAnimation.prototype = { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 }; | 165 }; |
166 | 166 |
167 return { | 167 return { |
168 TimelineDisplayTransformPanAnimation: | 168 TimelineDisplayTransformPanAnimation: |
169 TimelineDisplayTransformPanAnimation, | 169 TimelineDisplayTransformPanAnimation, |
170 TimelineDisplayTransformZoomToAnimation: | 170 TimelineDisplayTransformZoomToAnimation: |
171 TimelineDisplayTransformZoomToAnimation | 171 TimelineDisplayTransformZoomToAnimation |
172 }; | 172 }; |
173 }); | 173 }); |
174 </script> | 174 </script> |
OLD | NEW |