Chromium Code Reviews| Index: Source/devtools/front_end/components/FlameChart.js |
| diff --git a/Source/devtools/front_end/components/FlameChart.js b/Source/devtools/front_end/components/FlameChart.js |
| index 42637d929c50adde4bc15073d3f64c945ea50812..ec64628fccfd1066c8a19637750d204ec5683e09 100644 |
| --- a/Source/devtools/front_end/components/FlameChart.js |
| +++ b/Source/devtools/front_end/components/FlameChart.js |
| @@ -440,6 +440,29 @@ WebInspector.FlameChart.prototype = { |
| } |
| }, |
| + _revealEntry: function(entryIndex) |
| + { |
| + var timelineData = this._timelineData(); |
|
yurys
2014/11/06 11:39:58
Should we check for null data like in some other p
loislo
2014/11/09 15:32:57
Done.
|
| + var entryStartTime = timelineData.entryStartTimes[entryIndex]; |
| + var entryTotalTime = timelineData.entryTotalTimes[entryIndex]; |
| + var entryEndTime = entryStartTime + entryTotalTime; |
| + var minEntryTimeWindow = Math.min(entryTotalTime, this._timeWindowRight - this._timeWindowLeft); |
| + |
| + var y = this._levelToHeight(timelineData.entryLevels[entryIndex]); |
| + if (y < this._vScrollElement.scrollTop) |
| + this._vScrollElement.scrollTop = y; |
|
yurys
2014/11/06 11:39:58
Did you consider scrolling it so that selected bar
|
| + else if (y > this._vScrollElement.scrollTop + this._offsetHeight + this._barHeightDelta) |
| + this._vScrollElement.scrollTop = y - this._offsetHeight - this._barHeightDelta; |
| + |
| + if (this._timeWindowLeft > entryEndTime) { |
| + var delta = this._timeWindowLeft - entryEndTime + minEntryTimeWindow; |
|
yurys
2014/11/06 11:39:58
How about delta = this._timeWindowLeft - entrySta
loislo
2014/11/09 15:32:57
The idea is to do the minimal scrolling but show a
|
| + this._flameChartDelegate.requestWindowTimes(this._timeWindowLeft - delta, this._timeWindowRight - delta); |
| + } else if (this._timeWindowRight < entryStartTime) { |
| + var delta = entryStartTime - this._timeWindowRight + minEntryTimeWindow; |
|
yurys
2014/11/06 11:39:58
Maybe delta = entryStartTime - this._timeWindowLef
loislo
2014/11/09 15:32:57
ditto
|
| + this._flameChartDelegate.requestWindowTimes(this._timeWindowLeft + delta, this._timeWindowRight + delta); |
| + } |
| + }, |
| + |
| /** |
| * @param {number} startTime |
| * @param {number} endTime |
| @@ -1093,6 +1116,7 @@ WebInspector.FlameChart.prototype = { |
| setSelectedEntry: function(entryIndex) |
| { |
| this._selectedEntryIndex = entryIndex; |
| + this._revealEntry(entryIndex); |
| this._updateElementPosition(this._selectedElement, this._selectedEntryIndex); |
| }, |