OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |