Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: tracing/tracing/ui/base/timing_tool.html

Issue 2771723003: [tracing] Move math utilities from base into their own subdirectory (attempt 2) (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tracing/tracing/ui/base/scatter_chart_test.html ('k') | tracing/tracing/ui/base/utils.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 7
8 <link rel="import" href="/tracing/base/range.html"> 8 <link rel="import" href="/tracing/base/math/range.html">
9 <link rel="import" href="/tracing/model/event_set.html"> 9 <link rel="import" href="/tracing/model/event_set.html">
10 <link rel="import" href="/tracing/model/slice.html"> 10 <link rel="import" href="/tracing/model/slice.html">
11 <link rel="import" href="/tracing/ui/base/ui.html"> 11 <link rel="import" href="/tracing/ui/base/ui.html">
12 12
13 <script> 13 <script>
14 'use strict'; 14 'use strict';
15 15
16 /** 16 /**
17 * @fileoverview Provides the TimingTool class. 17 * @fileoverview Provides the TimingTool class.
18 */ 18 */
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 var pixWidth = dt.xViewVectorToWorld(1); 265 var pixWidth = dt.xViewVectorToWorld(1);
266 266
267 // Create result object with the mouse coordinates. 267 // Create result object with the mouse coordinates.
268 var result = { 268 var result = {
269 x: worldX, 269 x: worldX,
270 y: mouseY - modelTrackContainerRect.top, 270 y: mouseY - modelTrackContainerRect.top,
271 height: 0, 271 height: 0,
272 snapped: false 272 snapped: false
273 }; 273 };
274 274
275 var eventBounds = new tr.b.Range(); 275 var eventBounds = new tr.b.math.Range();
276 for (var event of selection) { 276 for (var event of selection) {
277 var track = viewport.trackForEvent(event); 277 var track = viewport.trackForEvent(event);
278 var trackRect = track.getBoundingClientRect(); 278 var trackRect = track.getBoundingClientRect();
279 279
280 eventBounds.reset(); 280 eventBounds.reset();
281 event.addBoundsToRange(eventBounds); 281 event.addBoundsToRange(eventBounds);
282 var eventX; 282 var eventX;
283 if (Math.abs(eventBounds.min - worldX) < 283 if (Math.abs(eventBounds.min - worldX) <
284 Math.abs(eventBounds.max - worldX)) { 284 Math.abs(eventBounds.max - worldX)) {
285 eventX = eventBounds.min; 285 eventX = eventBounds.min;
(...skipping 25 matching lines...) Expand all
311 311
312 return result; 312 return result;
313 } 313 }
314 }; 314 };
315 315
316 return { 316 return {
317 TimingTool, 317 TimingTool,
318 }; 318 };
319 }); 319 });
320 </script> 320 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/ui/base/scatter_chart_test.html ('k') | tracing/tracing/ui/base/utils.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698