| 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 var timeLeft = this._cancelWindowTimesAnimation ? this._pendingAnimationTime
Left : this._timeWindowLeft; | 206 var timeLeft = this._cancelWindowTimesAnimation ? this._pendingAnimationTime
Left : this._timeWindowLeft; |
| 207 var timeRight = this._cancelWindowTimesAnimation ? this._pendingAnimationTim
eRight : this._timeWindowRight; | 207 var timeRight = this._cancelWindowTimesAnimation ? this._pendingAnimationTim
eRight : this._timeWindowRight; |
| 208 var entryStartTime = timelineData.entryStartTimes[entryIndex]; | 208 var entryStartTime = timelineData.entryStartTimes[entryIndex]; |
| 209 var entryTotalTime = timelineData.entryTotalTimes[entryIndex]; | 209 var entryTotalTime = timelineData.entryTotalTimes[entryIndex]; |
| 210 var entryEndTime = entryStartTime + entryTotalTime; | 210 var entryEndTime = entryStartTime + entryTotalTime; |
| 211 var minEntryTimeWindow = Math.min(entryTotalTime, timeRight - timeLeft); | 211 var minEntryTimeWindow = Math.min(entryTotalTime, timeRight - timeLeft); |
| 212 | 212 |
| 213 var y = this._levelToHeight(timelineData.entryLevels[entryIndex]); | 213 var y = this._levelToHeight(timelineData.entryLevels[entryIndex]); |
| 214 this.setScrollOffset(y, this._barHeight); | 214 this.setScrollOffset(y, this._barHeight); |
| 215 | 215 |
| 216 var minVisibleWidthPx = 30; |
| 217 var futurePixelToTime = (timeRight - timeLeft) / this._offsetWidth; |
| 218 minEntryTimeWindow = Math.max(minEntryTimeWindow, futurePixelToTime * minVis
ibleWidthPx); |
| 216 if (timeLeft > entryEndTime) { | 219 if (timeLeft > entryEndTime) { |
| 217 var delta = timeLeft - entryEndTime + minEntryTimeWindow; | 220 var delta = timeLeft - entryEndTime + minEntryTimeWindow; |
| 218 this._flameChartDelegate.requestWindowTimes(timeLeft - delta, timeRight -
delta); | 221 this._flameChartDelegate.requestWindowTimes(timeLeft - delta, timeRight -
delta); |
| 219 } else if (timeRight < entryStartTime) { | 222 } else if (timeRight < entryStartTime) { |
| 220 var delta = entryStartTime - timeRight + minEntryTimeWindow; | 223 var delta = entryStartTime - timeRight + minEntryTimeWindow; |
| 221 this._flameChartDelegate.requestWindowTimes(timeLeft + delta, timeRight +
delta); | 224 this._flameChartDelegate.requestWindowTimes(timeLeft + delta, timeRight +
delta); |
| 222 } | 225 } |
| 223 } | 226 } |
| 224 | 227 |
| 225 /** | 228 /** |
| (...skipping 1371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1597 } | 1600 } |
| 1598 | 1601 |
| 1599 /** | 1602 /** |
| 1600 * @override | 1603 * @override |
| 1601 * @return {number} | 1604 * @return {number} |
| 1602 */ | 1605 */ |
| 1603 boundarySpan() { | 1606 boundarySpan() { |
| 1604 return this._maximumBoundaries - this._minimumBoundaries; | 1607 return this._maximumBoundaries - this._minimumBoundaries; |
| 1605 } | 1608 } |
| 1606 }; | 1609 }; |
| OLD | NEW |