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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 */ | 485 */ |
486 UI.TimelineOverviewBase = class extends UI.VBox { | 486 UI.TimelineOverviewBase = class extends UI.VBox { |
487 constructor() { | 487 constructor() { |
488 super(); | 488 super(); |
489 /** @type {?UI.TimelineOverviewCalculator} */ | 489 /** @type {?UI.TimelineOverviewCalculator} */ |
490 this._calculator = null; | 490 this._calculator = null; |
491 this._canvas = this.element.createChild('canvas', 'fill'); | 491 this._canvas = this.element.createChild('canvas', 'fill'); |
492 this._context = this._canvas.getContext('2d'); | 492 this._context = this._canvas.getContext('2d'); |
493 } | 493 } |
494 | 494 |
| 495 /** @return {number} */ |
| 496 width() { |
| 497 return this._canvas.width; |
| 498 } |
| 499 |
| 500 /** @return {number} */ |
| 501 height() { |
| 502 return this._canvas.height; |
| 503 } |
| 504 |
| 505 /** @return {!CanvasRenderingContext2D} */ |
| 506 context() { |
| 507 return this._context; |
| 508 } |
| 509 |
495 /** | 510 /** |
496 * @override | 511 * @override |
497 */ | 512 */ |
498 update() { | 513 update() { |
499 this.resetCanvas(); | 514 this.resetCanvas(); |
500 } | 515 } |
501 | 516 |
502 /** | 517 /** |
503 * @override | 518 * @override |
504 */ | 519 */ |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 left: haveRecords && startTime ? Math.min((startTime - absoluteMin) / time
Span, 1) : 0, | 590 left: haveRecords && startTime ? Math.min((startTime - absoluteMin) / time
Span, 1) : 0, |
576 right: haveRecords && endTime < Infinity ? (endTime - absoluteMin) / timeS
pan : 1 | 591 right: haveRecords && endTime < Infinity ? (endTime - absoluteMin) / timeS
pan : 1 |
577 }; | 592 }; |
578 } | 593 } |
579 | 594 |
580 resetCanvas() { | 595 resetCanvas() { |
581 this._canvas.width = this.element.clientWidth * window.devicePixelRatio; | 596 this._canvas.width = this.element.clientWidth * window.devicePixelRatio; |
582 this._canvas.height = this.element.clientHeight * window.devicePixelRatio; | 597 this._canvas.height = this.element.clientHeight * window.devicePixelRatio; |
583 } | 598 } |
584 }; | 599 }; |
OLD | NEW |