OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2014 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2014 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 | 7 |
8 <link rel="import" href="/tracing/base/range.html"> | 8 <link rel="import" href="/tracing/base/math/range.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 /** | 14 /** |
15 * @constructor | 15 * @constructor |
16 */ | 16 */ |
17 function SnapIndicator(y, height) { | 17 function SnapIndicator(y, height) { |
18 this.y = y; | 18 this.y = y; |
19 this.height = height; | 19 this.height = height; |
20 } | 20 } |
21 | 21 |
22 /** | 22 /** |
23 * The interesting part of the world. | 23 * The interesting part of the world. |
24 * | 24 * |
25 * @constructor | 25 * @constructor |
26 */ | 26 */ |
27 function TimelineInterestRange(vp) { | 27 function TimelineInterestRange(vp) { |
28 this.viewport_ = vp; | 28 this.viewport_ = vp; |
29 | 29 |
30 this.range_ = new tr.b.Range(); | 30 this.range_ = new tr.b.math.Range(); |
31 | 31 |
32 this.leftSelected_ = false; | 32 this.leftSelected_ = false; |
33 this.rightSelected_ = false; | 33 this.rightSelected_ = false; |
34 | 34 |
35 this.leftSnapIndicator_ = undefined; | 35 this.leftSnapIndicator_ = undefined; |
36 this.rightSnapIndicator_ = undefined; | 36 this.rightSnapIndicator_ = undefined; |
37 } | 37 } |
38 | 38 |
39 TimelineInterestRange.prototype = { | 39 TimelineInterestRange.prototype = { |
40 get isEmpty() { | 40 get isEmpty() { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 this.range_.min = min; | 78 this.range_.min = min; |
79 this.range_.max = max; | 79 this.range_.max = max; |
80 this.viewport_.dispatchChangeEvent(); | 80 this.viewport_.dispatchChangeEvent(); |
81 }, | 81 }, |
82 | 82 |
83 get range() { | 83 get range() { |
84 return this.range_.range; | 84 return this.range_.range; |
85 }, | 85 }, |
86 | 86 |
87 asRangeObject: function() { | 87 asRangeObject: function() { |
88 var range = new tr.b.Range(); | 88 var range = new tr.b.math.Range(); |
89 range.addRange(this.range_); | 89 range.addRange(this.range_); |
90 return range; | 90 return range; |
91 }, | 91 }, |
92 | 92 |
93 get leftSelected() { | 93 get leftSelected() { |
94 return this.leftSelected_; | 94 return this.leftSelected_; |
95 }, | 95 }, |
96 | 96 |
97 set leftSelected(leftSelected) { | 97 set leftSelected(leftSelected) { |
98 if (this.leftSelected_ === leftSelected) | 98 if (this.leftSelected_ === leftSelected) |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 ctx.restore(); | 239 ctx.restore(); |
240 } | 240 } |
241 }; | 241 }; |
242 | 242 |
243 return { | 243 return { |
244 SnapIndicator, | 244 SnapIndicator, |
245 TimelineInterestRange, | 245 TimelineInterestRange, |
246 }; | 246 }; |
247 }); | 247 }); |
248 </script> | 248 </script> |
OLD | NEW |