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

Side by Side Diff: Source/devtools/front_end/timeline/TimelineOverviewPane.js

Issue 322783002: Initialize min/max record time to 0 instead of -1 or null (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 402
403 /** 403 /**
404 * @param {number} startTime 404 * @param {number} startTime
405 * @param {number} endTime 405 * @param {number} endTime
406 * @return {!{left: number, right: number}} 406 * @return {!{left: number, right: number}}
407 */ 407 */
408 windowBoundaries: function(startTime, endTime) 408 windowBoundaries: function(startTime, endTime)
409 { 409 {
410 var absoluteMin = this._model.minimumRecordTime(); 410 var absoluteMin = this._model.minimumRecordTime();
411 var timeSpan = this._model.maximumRecordTime() - absoluteMin; 411 var timeSpan = this._model.maximumRecordTime() - absoluteMin;
412 var haveRecords = absoluteMin >= 0; 412 var haveRecords = absoluteMin > 0;
413 return { 413 return {
414 left: haveRecords && startTime ? Math.min((startTime - absoluteMin) / timeSpan, 1) : 0, 414 left: haveRecords && startTime ? Math.min((startTime - absoluteMin) / timeSpan, 1) : 0,
415 right: haveRecords && endTime < Infinity ? (endTime - absoluteMin) / timeSpan : 1 415 right: haveRecords && endTime < Infinity ? (endTime - absoluteMin) / timeSpan : 1
416 } 416 }
417 }, 417 },
418 418
419 resetCanvas: function() 419 resetCanvas: function()
420 { 420 {
421 this._canvas.width = this.element.clientWidth * window.devicePixelRatio; 421 this._canvas.width = this.element.clientWidth * window.devicePixelRatio;
422 this._canvas.height = this.element.clientHeight * window.devicePixelRati o; 422 this._canvas.height = this.element.clientHeight * window.devicePixelRati o;
423 }, 423 },
424 424
425 __proto__: WebInspector.VBox.prototype 425 __proto__: WebInspector.VBox.prototype
426 } 426 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineModel.js ('k') | Source/devtools/front_end/timeline/TimelinePanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698