| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 /** | 4 /** |
| 5 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 WebInspector.AnimationGroupPreviewUI = class { | 7 Animation.AnimationGroupPreviewUI = class { |
| 8 /** | 8 /** |
| 9 * @param {!WebInspector.AnimationModel.AnimationGroup} model | 9 * @param {!Animation.AnimationModel.AnimationGroup} model |
| 10 */ | 10 */ |
| 11 constructor(model) { | 11 constructor(model) { |
| 12 this._model = model; | 12 this._model = model; |
| 13 this.element = createElementWithClass('div', 'animation-buffer-preview'); | 13 this.element = createElementWithClass('div', 'animation-buffer-preview'); |
| 14 this.element.createChild('div', 'animation-paused fill'); | 14 this.element.createChild('div', 'animation-paused fill'); |
| 15 this._removeButton = this.element.createChild('div', 'animation-remove-butto
n'); | 15 this._removeButton = this.element.createChild('div', 'animation-remove-butto
n'); |
| 16 this._removeButton.textContent = '\u2715'; | 16 this._removeButton.textContent = '\u2715'; |
| 17 this._replayOverlayElement = this.element.createChild('div', 'animation-buff
er-preview-animation'); | 17 this._replayOverlayElement = this.element.createChild('div', 'animation-buff
er-preview-animation'); |
| 18 this._svg = this.element.createSVGChild('svg'); | 18 this._svg = this.element.createSVGChild('svg'); |
| 19 this._svg.setAttribute('width', '100%'); | 19 this._svg.setAttribute('width', '100%'); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 var numberOfAnimations = Math.min(this._model.animations().length, maxToShow
); | 60 var numberOfAnimations = Math.min(this._model.animations().length, maxToShow
); |
| 61 var timeToPixelRatio = 100 / Math.max(this._groupDuration(), 750); | 61 var timeToPixelRatio = 100 / Math.max(this._groupDuration(), 750); |
| 62 for (var i = 0; i < numberOfAnimations; i++) { | 62 for (var i = 0; i < numberOfAnimations; i++) { |
| 63 var effect = this._model.animations()[i].source(); | 63 var effect = this._model.animations()[i].source(); |
| 64 var line = this._svg.createSVGChild('line'); | 64 var line = this._svg.createSVGChild('line'); |
| 65 line.setAttribute('x1', effect.delay() * timeToPixelRatio); | 65 line.setAttribute('x1', effect.delay() * timeToPixelRatio); |
| 66 line.setAttribute('x2', (effect.delay() + effect.duration()) * timeToPixel
Ratio); | 66 line.setAttribute('x2', (effect.delay() + effect.duration()) * timeToPixel
Ratio); |
| 67 var y = Math.floor(this._viewBoxHeight / Math.max(6, numberOfAnimations) *
i + 1); | 67 var y = Math.floor(this._viewBoxHeight / Math.max(6, numberOfAnimations) *
i + 1); |
| 68 line.setAttribute('y1', y); | 68 line.setAttribute('y1', y); |
| 69 line.setAttribute('y2', y); | 69 line.setAttribute('y2', y); |
| 70 line.style.stroke = WebInspector.AnimationUI.Color(this._model.animations(
)[i]); | 70 line.style.stroke = Animation.AnimationUI.Color(this._model.animations()[i
]); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 }; | 73 }; |
| OLD | NEW |