Chromium Code Reviews| Index: Source/devtools/front_end/FlameChart.js |
| diff --git a/Source/devtools/front_end/FlameChart.js b/Source/devtools/front_end/FlameChart.js |
| index d4aeffbb2bc66237ae6ac96208b5ff55d6ef5e01..b7aa0936ef1da7865b191851a9df3eed71a60824 100644 |
| --- a/Source/devtools/front_end/FlameChart.js |
| +++ b/Source/devtools/front_end/FlameChart.js |
| @@ -425,15 +425,6 @@ WebInspector.FlameChart.OverviewPane = function(dataProvider) |
| WebInspector.FlameChart.OverviewPane.prototype = { |
| /** |
| - * @param {number} zoom |
| - * @param {number} referencePoint |
| - */ |
| - zoom: function(zoom, referencePoint) |
| - { |
| - this._overviewGrid.zoom(zoom, referencePoint); |
| - }, |
| - |
| - /** |
| * @param {number} windowStartTime |
| * @param {number} windowEndTime |
| */ |
| @@ -736,14 +727,15 @@ WebInspector.FlameChart.MainPane.prototype = { |
| */ |
| _onMouseWheel: function(e) |
| { |
| - var windowLeft = this._timeWindowLeft; |
| - var windowRight = this._timeWindowRight; |
| + var windowLeft = this._timeWindowLeft ? this._timeWindowLeft : this._dataProvider.zeroTime(); |
|
pfeldman
2014/03/05 05:33:50
I think using -1 for default values is more approp
|
| + var windowRight = this._timeWindowRight !== Infinity ? this._timeWindowRight : this._dataProvider.zeroTime() + this._dataProvider.totalTime(); |
| + |
| if (e.wheelDeltaY) { |
| const mouseWheelZoomSpeed = 1 / 120; |
| var zoom = Math.pow(1.2, -e.wheelDeltaY * mouseWheelZoomSpeed) - 1; |
| var cursorTime = this._cursorTime(e.offsetX); |
| - windowLeft += (this._timeWindowLeft - cursorTime) * zoom; |
| - windowRight += (this._timeWindowRight - cursorTime) * zoom; |
| + windowLeft += (windowLeft - cursorTime) * zoom; |
| + windowRight += (windowRight - cursorTime) * zoom; |
| } else { |
| var shift = e.wheelDeltaX * this._pixelToTime; |
| shift = Number.constrain(shift, this._zeroTime - windowLeft, this._totalTime + this._zeroTime - windowRight); |